/** * 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. * * @param boolean $flat 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. * * @since 4.2.2 */ public function boundExceptions($flat = true) { if (!$this->recurrence) { return array(); } $return = array(); $kronolith_driver = Kronolith::getDriver(null, $this->calendar); $search = new StdClass(); $search->start = $this->recurrence->getRecurStart(); $search->end = $this->recurrence->getRecurEnd(); $search->baseid = $this->uid; $results = $kronolith_driver->search($search); if (!$flat) { return $results; } foreach ($results as $days) { foreach ($days as $exception) { $return[] = $exception; } } return $return; }
/** * Return whether or not this object is equal to another recurrence object. * The objects are considered equal if the recurrence rules are the same. * This does not take any exceptions into account. * * @param Horde_Date_Recurrence $recurrence The recurrence object to check * equality to. * * @return boolean True if the recurrence rules are the same. * @since 2.2.0 */ public function isEqual(Horde_Date_Recurrence $recurrence) { return $this->getRecurType() == $recurrence->getRecurType() && $this->getRecurInterval() == $recurrence->getRecurInterval() && $this->getRecurCount() == $recurrence->getRecurCount() && $this->getRecurEnd() == $recurrence->getRecurEnd() && $this->getRecurStart() == $recurrence->getRecurStart() && $this->getRecurOnDays() == $recurrence->getRecurOnDays(); }