Class Nag_Recurrence

Description

The Nag_Recurrence class implements algorithms for calculating recurrences of events, including several recurrence types, intervals, exceptions, and conversion from and to vCalendar and iCalendar recurrence rules.

All methods expecting dates as parameters accept all values that the Horde_Date constructor accepts, i.e. a timestamp, another Horde_Date object, an ISO time string or a hash.

Located in /lib/Recurrence.php (line 53)


	
			
Variable Summary
 array $completions
 array $exceptions
 integer $recurCount
 integer $recurData
 Horde_Date $recurEnd
 integer $recurInterval
 integer $recurType
 Horde_Date $start
Method Summary
 Nag_Recurrence Nag_Recurrence (Horde_Date $start)
 void addCompletion (integer $year, integer $month, integer $mday)
 void addException (integer $year, integer $month, integer $mday)
 void deleteCompletion (integer $year, integer $month, integer $mday)
 void deleteException (integer $year, integer $month, integer $mday)
 boolean fromHash (array $hash)
 void fromRRule10 (string $rrule)
 void fromRRule20 (string $rrule)
 array getCompletions ()
 array getExceptions ()
 integer getRecurCount ()
 Horde_Date getRecurEnd ()
 integer getRecurInterval ()
 string getRecurName ()
 integer getRecurOnDays ()
 Horde_Date getRecurStart ()
 integer getRecurType ()
 boolean hasActiveRecurrence ()
 boolean hasCompletion (integer $year, integer $month, integer $mday)
 boolean hasException (integer $year, integer $month, integer $mday)
 boolean hasRecurCount ()
 boolean hasRecurEnd ()
 boolean hasRecurType (integer $recurrence)
 Horde_Date|boolean nextActiveRecurrence (Horde_Date $afterDate)
 Horde_Date|boolean nextRecurrence (Horde_Date $afterDate)
 boolean recurOnDay (integer $dayMask)
 void setRecurCount (integer $count)
 void setRecurEnd (Horde_Date $end)
 void setRecurInterval (integer $interval)
 void setRecurOnDay (integer $dayMask)
 void setRecurStart (Horde_Date $start)
 void setRecurType (integer $recurrence)
 array toHash ()
 string toRRule10 (Horde_iCalendar $calendar)
 string toRRule20 (Horde_iCalendar $calendar)
Variables
array $completions = array() (line 110)

All the dates this recurrence has been marked as completed.

array $exceptions = array() (line 103)

All the exceptions from recurrence for this event.

integer $recurCount = null (line 74)

The number of recurrences.

integer $recurData = null (line 96)

Any additional recurrence data.

Horde_Date $recurEnd = null (line 67)

The end date of the recurrence interval.

integer $recurInterval = 1 (line 89)

The length of time between recurrences. The time unit depends on the recurrence type.

integer $recurType = NAG_RECUR_NONE (line 81)

The type of recurrence this event follows. NAG_RECUR_* constant.

Horde_Date $start (line 60)

The start time of the event.

Methods
Constructor Nag_Recurrence (line 117)

Constructor.

Nag_Recurrence Nag_Recurrence (Horde_Date $start)
  • Horde_Date $start: Start of the recurring event.
addCompletion (line 750)

Adds a completion to a recurring event.

void addCompletion (integer $year, integer $month, integer $mday)
  • integer $year: The year of the execption.
  • integer $month: The month of the execption.
  • integer $mday: The day of the month of the completion.
addException (line 697)

Adds an exception to a recurring event.

void addException (integer $year, integer $month, integer $mday)
  • integer $year: The year of the execption.
  • integer $month: The month of the execption.
  • integer $mday: The day of the month of the exception.
deleteCompletion (line 762)

Deletes a completion from a recurring event.

void deleteCompletion (integer $year, integer $month, integer $mday)
  • integer $year: The year of the execption.
  • integer $month: The month of the execption.
  • integer $mday: The day of the month of the completion.
deleteException (line 709)

Deletes an exception from a recurring event.

void deleteException (integer $year, integer $month, integer $mday)
  • integer $year: The year of the execption.
  • integer $month: The month of the execption.
  • integer $mday: The day of the month of the exception.
fromHash (line 1145)

Parses the recurrence data from a hash.

  • return: True if the hash seemed valid, false otherwise.
boolean fromHash (array $hash)
  • array $hash: The hash to convert.
fromRRule10 (line 804)

Parses a vCalendar 1.0 recurrence rule.

void fromRRule10 (string $rrule)
  • string $rrule: A vCalendar 1.0 conform RRULE value.
fromRRule20 (line 966)

Parses an iCalendar 2.0 recurrence rule.

void fromRRule20 (string $rrule)
  • string $rrule: An iCalendar 2.0 conform RRULE value.
getCompletions (line 791)

Retrieves all the completions for this event.

  • return: Array containing the dates of all the completions in YYYYMMDD form.
array getCompletions ()
getExceptions (line 738)

Retrieves all the exceptions for this event.

  • return: Array containing the dates of all the exceptions in YYYYMMDD form.
array getExceptions ()
getRecurCount (line 252)

Retrieves the number of recurrences of this event.

  • return: The number recurrences.
integer getRecurCount ()
getRecurEnd (line 306)

Retrieves the end date of the recurrence interval.

  • return: The recurrence end.
Horde_Date getRecurEnd ()
getRecurInterval (line 226)

Retrieves the length of time between recurrences of this event.

  • return: The number of seconds between recurrences.
integer getRecurInterval ()
getRecurName (line 195)

Returns a description of this event's recurring type.

  • return: Human readable recurring type.
string getRecurName ()
getRecurOnDays (line 152)

Returns the days this event recurs on.

  • return: A mask consisting of HORDE_DATE_MASK_* constants specifying the day(s) this event recurs on.
integer getRecurOnDays ()
getRecurStart (line 282)

Retrieves the start date of the recurrence interval.

  • return: The recurrence start.
Horde_Date getRecurStart ()
getRecurType (line 185)

Returns recurrence type of this event.

  • return: A NAG_RECUR_* constant.
integer getRecurType ()
hasActiveRecurrence (line 641)

Returns whether this event has any date that matches the recurrence rules and is not an exception.

  • return: True if an active recurrence exists.
boolean hasActiveRecurrence ()
hasCompletion (line 779)

Checks if a completion exists for a given reccurence of an event.

  • return: True if a completion exists for the given date.
boolean hasCompletion (integer $year, integer $month, integer $mday)
  • integer $year: The year of the reucrance.
  • integer $month: The month of the recurrance.
  • integer $mday: The day of the month of the recurrance.
hasException (line 726)

Checks if an exception exists for a given reccurence of an event.

  • return: True if an exception exists for the given date.
boolean hasException (integer $year, integer $month, integer $mday)
  • integer $year: The year of the reucrance.
  • integer $month: The month of the reucrance.
  • integer $mday: The day of the month of the reucrance.
hasRecurCount (line 262)

Returns whether this event has a recurrence with a fixed count.

  • return: True if this recurrence has a fixed count.
boolean hasRecurCount ()
hasRecurEnd (line 316)

Returns whether this event has a recurrence end.

  • return: True if this recurrence ends.
boolean hasRecurEnd ()
hasRecurType (line 165)

Returns whether this event has a specific recurrence type.

  • return: True if the event has the specified recurrence type.
boolean hasRecurType (integer $recurrence)
  • integer $recurrence: NAG_RECUR_* constant of the recurrence type to check for.
nextActiveRecurrence (line 675)

Returns the next active recurrence.

  • return: The date of the next active recurrence or false if the event has no active recurrence after $afterDate.
Horde_Date|boolean nextActiveRecurrence (Horde_Date $afterDate)
  • Horde_Date $afterDate: Return events after this date.
nextRecurrence (line 331)

Finds the next recurrence of this event that's after $afterDate.

  • return: The date of the next recurrence or false if the event does not recur after $afterDate.
Horde_Date|boolean nextRecurrence (Horde_Date $afterDate)
  • Horde_Date $afterDate: Return events after this date.
recurOnDay (line 130)

Checks if this event recurs on a given day of the week.

  • return: True if this event recurs on the given day(s).
boolean recurOnDay (integer $dayMask)
  • integer $dayMask: A mask consisting of HORDE_DATE_MASK_* constants specifying the day(s) to check.
setRecurCount (line 236)

Sets the number of recurrences of this event.

void setRecurCount (integer $count)
  • integer $count: The number of recurrences.
setRecurEnd (line 292)

Sets the end date of the recurrence interval.

void setRecurEnd (Horde_Date $end)
  • Horde_Date $end: The recurrence end.
setRecurInterval (line 214)

Sets the length of time between recurrences of this event.

void setRecurInterval (integer $interval)
  • integer $interval: The time between recurrences.
setRecurOnDay (line 141)

Specifies the days this event recurs on.

void setRecurOnDay (integer $dayMask)
  • integer $dayMask: A mask consisting of HORDE_DATE_MASK_* constants specifying the day(s) to recur on.
setRecurStart (line 272)

Sets the start date of the recurrence interval.

void setRecurStart (Horde_Date $start)
  • Horde_Date $start: The recurrence start.
setRecurType (line 175)

Sets a recurrence type for this event.

void setRecurType (integer $recurrence)
  • integer $recurrence: A NAG_RECUR_* constant.
toHash (line 1356)

Export this object into a hash.

  • return: The recurrence hash.
array toHash ()
toRRule10 (line 898)

Creates a vCalendar 1.0 recurrence rule.

string toRRule10 (Horde_iCalendar $calendar)
  • Horde_iCalendar $calendar: A Horde_iCalendar object instance.
toRRule20 (line 1061)

Creates an iCalendar 2.0 recurrence rule.

string toRRule20 (Horde_iCalendar $calendar)
  • Horde_iCalendar $calendar: A Horde_iCalendar object instance.

Documentation generated on Sun, 30 Jan 2011 05:35:04 +0000 by phpDocumentor 1.4.3