| 
      
      
      From: <gem...@li...> - 2012-11-22 11:17:40
      
     | 
| Revision: 1029
          http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1029&view=rev
Author:   mennodekker
Date:     2012-11-22 11:17:29 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
initial setup
Modified Paths:
--------------
    branches/receptioncodes/library/classes/Gems/Events.php
Added Paths:
-----------
    branches/receptioncodes/library/classes/Gems/Event/ReceptionCode/
    branches/receptioncodes/library/classes/Gems/Event/ReceptionCodeEventInterface.php
Added: branches/receptioncodes/library/classes/Gems/Event/ReceptionCodeEventInterface.php
===================================================================
--- branches/receptioncodes/library/classes/Gems/Event/ReceptionCodeEventInterface.php	                        (rev 0)
+++ branches/receptioncodes/library/classes/Gems/Event/ReceptionCodeEventInterface.php	2012-11-22 11:17:29 UTC (rev 1029)
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *    * Redistributions of source code must retain the above copyright
+ *      notice, this list of conditions and the following disclaimer.
+ *    * Redistributions in binary form must reproduce the above copyright
+ *      notice, this list of conditions and the following disclaimer in the
+ *      documentation and/or other materials provided with the distribution.
+ *    * Neither the name of Erasmus MC nor the
+ *      names of its contributors may be used to endorse or promote products
+ *      derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package    Gems
+ * @subpackage Event
+ * @author     Menno Dekker <men...@er...>
+ * @copyright  Copyright (c) 2011 Erasmus MC
+ * @license    New BSD License
+ * @version    $Id: RoundChangedEventInterface.php 59 2011-09-22 07:23:44Z mennodekker $
+ */
+
+/**
+ * When settings a receptioncode this code runs
+ * 
+ * The code should take care of delegation to other objects
+ *
+ * @package    Gems
+ * @subpackage Event
+ * @copyright  Copyright (c) 2011 Erasmus MC
+ * @license    New BSD License
+ * @since      Class available since version 1.6
+ */
+class Gems_Event_ReceptionCodeEventInterface extends Gems_Event_EventInterface
+{
+    public function setReceptionCode($object, $receptionCode, $comment, $userId);
+}
\ No newline at end of file
Modified: branches/receptioncodes/library/classes/Gems/Events.php
===================================================================
--- branches/receptioncodes/library/classes/Gems/Events.php	2012-11-22 11:11:40 UTC (rev 1028)
+++ branches/receptioncodes/library/classes/Gems/Events.php	2012-11-22 11:17:29 UTC (rev 1029)
@@ -48,11 +48,12 @@
 {
     const EVENTS_DIR              = 'Event';
 
-    const TRACK_COMPLETION_EVENT        = 'Track/Completed';
+    const RECEPTIONCODE_EVENT           = 'ReceptionCode';
     const ROUND_CHANGED_EVENT           = 'Round/Changed';
     const SURVEY_BEFORE_ANSWERING_EVENT = 'Survey/BeforeAnswering';
     const SURVEY_COMPLETION_EVENT       = 'Survey/Completed';
     const SURVEY_DISPLAY_EVENT          = 'Survey/Display';
+    const TRACK_COMPLETION_EVENT        = 'Track/Completed';
 
     /**
      * Each event type must implement an event class or interface derived
@@ -63,11 +64,12 @@
      * @var array containing eventType => eventClass for all event classes
      */
     protected $_eventClasses = array(
-        self::TRACK_COMPLETION_EVENT        => 'Gems_Event_TrackCompletedEventInterface',
+        self::RECEPTIONCODE_EVENT           => 'Gems_Event_ReceptionCodeEventInterface',
         self::ROUND_CHANGED_EVENT           => 'Gems_Event_RoundChangedEventInterface',
         self::SURVEY_BEFORE_ANSWERING_EVENT => 'Gems_Event_SurveyBeforeAnsweringEventInterface',
         self::SURVEY_COMPLETION_EVENT       => 'Gems_Event_SurveyCompletedEventInterface',
         self::SURVEY_DISPLAY_EVENT          => 'Gems_Event_SurveyDisplayEventInterface',
+        self::TRACK_COMPLETION_EVENT        => 'Gems_Event_TrackCompletedEventInterface'
     );
 
     /**
@@ -204,6 +206,15 @@
 
         return $event;
     }
+    
+    /**
+     *
+     * @return array eventname => string
+     */
+    public function listReceptionCodeEvents()
+    {
+        return $this->_listEvents(self::RECEPTIONCODE_EVENT);
+    }
 
     /**
      *
@@ -249,10 +260,20 @@
     {
         return $this->_listEvents(self::TRACK_COMPLETION_EVENT);
     }
-
+    
     /**
      *
      * @param string $eventName
+     * @return Gems_Event_ReceptionCodeEventInterface
+     */
+    public function loadReceptionCodeEvent($eventName)
+    {
+        return $this->_loadEvent($eventName, self::RECEPTIONCODE_EVENT);
+    }
+
+    /**     
+     * 
+     * @param string $eventName
      * @return Gems_Event_RoundChangedEventInterface
      */
     public function loadRoundChangedEvent($eventName)
@@ -300,4 +321,4 @@
     {
         return $this->_loadEvent($eventName, self::TRACK_COMPLETION_EVENT);
     }
-}
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |