getRecurEnd() public method

Retrieves the end date of the recurrence interval.
public getRecurEnd ( ) : Horde_Date
return Horde_Date The recurrence end.
Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
Arquivo: Task.php Projeto: horde/horde
 /**
  * Set recurrence information for this task
  *
  * @param Horde_Date_Recurrence $recurrence
  */
 public function setRecurrence(Horde_Date_Recurrence $recurrence)
 {
     $r = Horde_ActiveSync::messageFactory('TaskRecurrence');
     // Map the type fields
     switch ($recurrence->recurType) {
         case Horde_Date_Recurrence::RECUR_DAILY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_DAILY;
             break;
         case Horde_Date_Recurrence::RECUR_WEEKLY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_WEEKLY;
             $r->dayofweek = $recurrence->getRecurOnDays();
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY;
             $r->dayofmonth = $recurrence->start->mday;
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY_NTH;
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLY;
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLYNTH;
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->monthofyear = $recurrence->start->month;
             break;
     }
     if (!empty($recurrence->recurInterval)) {
         $r->interval = $recurrence->recurInterval;
     }
     // AS messages can only have one or the other (or none), not both
     if ($recurrence->hasRecurCount()) {
         $r->occurrences = $recurrence->getRecurCount();
     } elseif ($recurrence->hasRecurEnd()) {
         $r->until = $recurrence->getRecurEnd();
     }
     // Set the start of the recurrence series.
     $r->start = clone $this->duedate;
     $this->_properties['recurrence'] = $r;
 }
Exemplo n.º 3
0
 /**
  * Set recurrence information for this appointment
  *
  * @param Horde_Date_Recurrence $recurrence  The recurrence data.
  * @param integer $fdow                      The first day of the week.
  *        (A Horde_ActiveSync_Message_Recurrence:: constant).  @since 2.4.0
  */
 public function setRecurrence(Horde_Date_Recurrence $recurrence, $fdow = null)
 {
     $r = Horde_ActiveSync::messageFactory('Recurrence');
     if ($this->_version >= Horde_ActiveSync::VERSION_FOURTEENONE) {
         $r->firstdayofweek = $fdow;
     }
     /* Map the type fields */
     switch ($recurrence->recurType) {
         case Horde_Date_Recurrence::RECUR_DAILY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_DAILY;
             break;
         case Horde_Date_Recurrence::RECUR_WEEKLY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_WEEKLY;
             $r->dayofweek = $recurrence->getRecurOnDays();
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY;
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY_NTH;
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLY;
             $r->monthofyear = $recurrence->start->month;
             $r->dayofmonth = $recurrence->start->mday;
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLYNTH;
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->monthofyear = $recurrence->start->month;
             break;
     }
     if (!empty($recurrence->recurInterval)) {
         $r->interval = $recurrence->recurInterval;
     }
     /* AS messages can only have one or the other (or none), not both */
     if ($recurrence->hasRecurCount()) {
         $r->occurrences = $recurrence->getRecurCount();
     } elseif ($recurrence->hasRecurEnd()) {
         $r->until = $recurrence->getRecurEnd();
     }
     // We don't support non-gregorian calendars.
     if ($this->_version >= Horde_ActiveSync::VERSION_FOURTEEN) {
         $r->calendartype = Horde_ActiveSync_Message_Recurrence::CALENDAR_TYPE_GREGORIAN;
     }
     $this->_properties['recurrence'] = $r;
 }
Exemplo n.º 4
0
 /**
  * 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();
 }