boundExceptions() public method

Returns a list of events that represent exceptions to this event's recurrence series, if any. If this event does not recur, an empty array is returned.
Since: 4.2.2
public boundExceptions ( boolean $flat = true ) : array
$flat boolean If true (the default), returns a flat array containing Kronolith_Event objects. If false, results are in the format of listEvents calls. @see Kronolith::listEvents().
return array An array of Kronolith_Event objects whose baseid property is equal to this event's uid. I.e., it is a bound exception.
Ejemplo n.º 1
0
 /**
  * Saves an event in the backend.
  *
  * If it is a new event, it is added, otherwise the event is updated.
  *
  * @param Kronolith_Event $event  The event to save.
  *
  * @return string  The event id.
  * @throws Horde_Mime_Exception
  * @throws Kronolith_Exception
  */
 public function saveEvent(Kronolith_Event $event)
 {
     if ($event->stored || $event->exists()) {
         // If this event recurs and has bound exceptions, we must make sure
         // that the exceptionoriginaldate is updated in those exceptions as
         // well. See Bug: 13512
         if ($event->recurs()) {
             foreach ($event->boundExceptions() as $bound) {
                 $t = $event->start->strftime('%T');
                 $bound->exceptionoriginaldate = new Horde_Date($bound->start->strftime('%Y-%m-%d') . 'T' . $t);
                 $bound->save();
             }
         }
         return $this->_updateEvent($event);
     }
     return $this->_addEvent($event);
 }