PHP Class Horde_Date_Recurrence, horde

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.
Author: Jan Schneider ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Свойство Type Description
$completions array All the dates this recurrence has been marked as completed.
$exceptions array All the exceptions from recurrence for this event.
$recurCount integer The number of recurrences.
$recurData integer Any additional recurrence data.
$recurEnd Horde_Date The end date of the recurrence interval.
$recurInterval integer The length of time between recurrences. The time unit depends on the recurrence type.
$recurType integer The type of recurrence this event follows. RECUR_* constant.
$start Horde_Date The start time of the event.

Méthodes publiques

Méthode Description
__construct ( Horde_Date $start ) Constructor.
addCompletion ( integer $year, integer $month, integer $mday ) Adds a completion to a recurring event.
addException ( integer $year, integer $month, integer $mday ) Adds an exception to a recurring event.
deleteCompletion ( integer $year, integer $month, integer $mday ) Deletes a completion from a recurring event.
deleteException ( integer $year, integer $month, integer $mday ) Deletes an exception from a recurring event.
fromKolab ( array $hash ) : boolean Parses the recurrence data from a Kolab hash.
fromRRule10 ( string $rrule ) Parses a vCalendar 1.0 recurrence rule.
fromRRule20 ( string $rrule ) Parses an iCalendar 2.0 recurrence rule.
getCompletions ( ) : array Retrieves all the completions for this event.
getExceptions ( ) : array Retrieves all the exceptions for this event.
getRecurCount ( ) : integer Retrieves the number of recurrences of this event.
getRecurEnd ( ) : Horde_Date Retrieves the end date of the recurrence interval.
getRecurInterval ( ) : integer Retrieves the length of time between recurrences of this event.
getRecurName ( ) : string Returns a description of this event's recurring type.
getRecurOnDays ( ) : integer Returns the days this event recurs on.
getRecurStart ( ) : Horde_Date Retrieves the start date of the recurrence interval.
getRecurType ( ) : integer Returns recurrence type of this event.
hasActiveRecurrence ( ) : boolean Returns whether this event has any date that matches the recurrence rules and is not an exception.
hasCompletion ( integer $year, integer $month, integer $mday ) : boolean Checks if a completion exists for a given reccurence of an event.
hasException ( integer $year, integer $month, integer $mday ) : boolean Checks if an exception exists for a given reccurence of an event.
hasRecurCount ( ) : boolean Returns whether this event has a recurrence with a fixed count.
hasRecurEnd ( ) : boolean Returns whether this event has a recurrence end.
hasRecurType ( integer $recurrence ) : boolean Returns whether this event has a specific recurrence type.
isEqual ( Horde_Date_Recurrence $recurrence ) : boolean Return whether or not this object is equal to another recurrence object.
nextActiveRecurrence ( Horde_Date $afterDate ) : Horde_Date | boolean Returns the next active recurrence.
nextRecurrence ( Horde_Date | string $after ) : Horde_Date | boolean Finds the next recurrence of this event that's after $afterDate.
recurOnDay ( integer $dayMask ) : boolean Checks if this event recurs on a given day of the week.
reset ( ) Resets the class properties.
setRecurCount ( integer $count ) Sets the number of recurrences of this event.
setRecurEnd ( Horde_Date $end ) Sets the end date of the recurrence interval.
setRecurInterval ( integer $interval ) Sets the length of time between recurrences of this event.
setRecurOnDay ( integer $dayMask ) Specifies the days this event recurs on.
setRecurStart ( Horde_Date $start ) Sets the start date of the recurrence interval.
setRecurType ( integer $recurrence ) Sets a recurrence type for this event.
toJson ( ) : object Returns a simple object suitable for json transport representing this object.
toKolab ( ) : array Export this object into a Kolab hash.
toRRule10 ( Horde_Icalendar $calendar ) : string Creates a vCalendar 1.0 recurrence rule.
toRRule20 ( Horde_Icalendar $calendar ) : string Creates an iCalendar 2.0 recurrence rule.
toString ( $date_format ) : string Output a human readable description of the recurrence rule.

Méthodes protégées

Méthode Description
_formatExceptionDate ( string $date, string $format ) : string Returns a correcty formatted exception date for recurring events.

Method Details

__construct() public méthode

Constructor.
public __construct ( Horde_Date $start )
$start Horde_Date Start of the recurring event.

_formatExceptionDate() protected méthode

Returns a correcty formatted exception date for recurring events.
Since: 2.1.0
protected _formatExceptionDate ( string $date, string $format ) : string
$date string Exception in the format Ymd.
$format string The format to display in.
Résultat string The formatted date and delete link.

addCompletion() public méthode

Adds a completion to a recurring event.
public addCompletion ( integer $year, integer $month, integer $mday )
$year integer The year of the exception.
$month integer The month of the exception.
$mday integer The day of the month of the completion.

addException() public méthode

Adds an exception to a recurring event.
public addException ( integer $year, integer $month, integer $mday )
$year integer The year of the exception.
$month integer The month of the exception.
$mday integer The day of the month of the exception.

deleteCompletion() public méthode

Deletes a completion from a recurring event.
public deleteCompletion ( integer $year, integer $month, integer $mday )
$year integer The year of the exception.
$month integer The month of the exception.
$mday integer The day of the month of the completion.

deleteException() public méthode

Deletes an exception from a recurring event.
public deleteException ( integer $year, integer $month, integer $mday )
$year integer The year of the exception.
$month integer The month of the exception.
$mday integer The day of the month of the exception.

fromKolab() public méthode

Parses the recurrence data from a Kolab hash.
public fromKolab ( array $hash ) : boolean
$hash array The hash to convert.
Résultat boolean True if the hash seemed valid, false otherwise.

fromRRule10() public méthode

Parses a vCalendar 1.0 recurrence rule.
public fromRRule10 ( string $rrule )
$rrule string A vCalendar 1.0 conform RRULE value.

fromRRule20() public méthode

Parses an iCalendar 2.0 recurrence rule.
public fromRRule20 ( string $rrule )
$rrule string An iCalendar 2.0 conform RRULE value.

getCompletions() public méthode

Retrieves all the completions for this event.
public getCompletions ( ) : array
Résultat array Array containing the dates of all the completions in YYYYMMDD form.

getExceptions() public méthode

Retrieves all the exceptions for this event.
public getExceptions ( ) : array
Résultat array Array containing the dates of all the exceptions in YYYYMMDD form.

getRecurCount() public méthode

Retrieves the number of recurrences of this event.
public getRecurCount ( ) : integer
Résultat integer The number recurrences.

getRecurEnd() public méthode

Retrieves the end date of the recurrence interval.
public getRecurEnd ( ) : Horde_Date
Résultat Horde_Date The recurrence end.

getRecurInterval() public méthode

Retrieves the length of time between recurrences of this event.
public getRecurInterval ( ) : integer
Résultat integer The number of seconds between recurrences.

getRecurName() public méthode

Returns a description of this event's recurring type.
public getRecurName ( ) : string
Résultat string Human readable recurring type.

getRecurOnDays() public méthode

Returns the days this event recurs on.
public getRecurOnDays ( ) : integer
Résultat integer A mask consisting of Horde_Date::MASK_* constants specifying the day(s) this event recurs on.

getRecurStart() public méthode

Retrieves the start date of the recurrence interval.
public getRecurStart ( ) : Horde_Date
Résultat Horde_Date The recurrence start.

getRecurType() public méthode

Returns recurrence type of this event.
public getRecurType ( ) : integer
Résultat integer A RECUR_* constant.

hasActiveRecurrence() public méthode

Returns whether this event has any date that matches the recurrence rules and is not an exception.
public hasActiveRecurrence ( ) : boolean
Résultat boolean True if an active recurrence exists.

hasCompletion() public méthode

Checks if a completion exists for a given reccurence of an event.
public hasCompletion ( integer $year, integer $month, integer $mday ) : boolean
$year integer The year of the recurrance.
$month integer The month of the recurrance.
$mday integer The day of the month of the recurrance.
Résultat boolean True if a completion exists for the given date.

hasException() public méthode

Checks if an exception exists for a given reccurence of an event.
public hasException ( integer $year, integer $month, integer $mday ) : boolean
$year integer The year of the reucrance.
$month integer The month of the reucrance.
$mday integer The day of the month of the reucrance.
Résultat boolean True if an exception exists for the given date.

hasRecurCount() public méthode

Returns whether this event has a recurrence with a fixed count.
public hasRecurCount ( ) : boolean
Résultat boolean True if this recurrence has a fixed count.

hasRecurEnd() public méthode

Returns whether this event has a recurrence end.
public hasRecurEnd ( ) : boolean
Résultat boolean True if this recurrence ends.

hasRecurType() public méthode

Returns whether this event has a specific recurrence type.
public hasRecurType ( integer $recurrence ) : boolean
$recurrence integer RECUR_* constant of the recurrence type to check for.
Résultat boolean True if the event has the specified recurrence type.

isEqual() public méthode

The objects are considered equal if the recurrence rules are the same. This does not take any exceptions into account.
Since: 2.2.0
public isEqual ( Horde_Date_Recurrence $recurrence ) : boolean
$recurrence Horde_Date_Recurrence The recurrence object to check equality to.
Résultat boolean True if the recurrence rules are the same.

nextActiveRecurrence() public méthode

Returns the next active recurrence.
public nextActiveRecurrence ( Horde_Date $afterDate ) : Horde_Date | boolean
$afterDate Horde_Date Return events after this date.
Résultat Horde_Date | boolean The date of the next active recurrence or false if the event has no active recurrence after $afterDate.

nextRecurrence() public méthode

Finds the next recurrence of this event that's after $afterDate.
public nextRecurrence ( Horde_Date | string $after ) : Horde_Date | boolean
$after Horde_Date | string Return events after this date.
Résultat Horde_Date | boolean The date of the next recurrence or false if the event does not recur after $afterDate.

recurOnDay() public méthode

Checks if this event recurs on a given day of the week.
public recurOnDay ( integer $dayMask ) : boolean
$dayMask integer A mask consisting of Horde_Date::MASK_* constants specifying the day(s) to check.
Résultat boolean True if this event recurs on the given day(s).

reset() public méthode

Resets the class properties.
public reset ( )

setRecurCount() public méthode

Sets the number of recurrences of this event.
public setRecurCount ( integer $count )
$count integer The number of recurrences.

setRecurEnd() public méthode

Sets the end date of the recurrence interval.
public setRecurEnd ( Horde_Date $end )
$end Horde_Date The recurrence end.

setRecurInterval() public méthode

Sets the length of time between recurrences of this event.
public setRecurInterval ( integer $interval )
$interval integer The time between recurrences.

setRecurOnDay() public méthode

Specifies the days this event recurs on.
public setRecurOnDay ( integer $dayMask )
$dayMask integer A mask consisting of Horde_Date::MASK_* constants specifying the day(s) to recur on.

setRecurStart() public méthode

Sets the start date of the recurrence interval.
public setRecurStart ( Horde_Date $start )
$start Horde_Date The recurrence start.

setRecurType() public méthode

Sets a recurrence type for this event.
public setRecurType ( integer $recurrence )
$recurrence integer A RECUR_* constant.

toJson() public méthode

Possible properties are: - t: type - i: interval - e: end date - c: count - d: data - co: completions - ex: exceptions
public toJson ( ) : object
Résultat object A simple object.

toKolab() public méthode

Export this object into a Kolab hash.
public toKolab ( ) : array
Résultat array The recurrence hash.

toRRule10() public méthode

Creates a vCalendar 1.0 recurrence rule.
public toRRule10 ( Horde_Icalendar $calendar ) : string
$calendar Horde_Icalendar A Horde_Icalendar object instance.
Résultat string A vCalendar 1.0 conform RRULE value.

toRRule20() public méthode

Creates an iCalendar 2.0 recurrence rule.
public toRRule20 ( Horde_Icalendar $calendar ) : string
$calendar Horde_Icalendar A Horde_Icalendar object instance.
Résultat string An iCalendar 2.0 conform RRULE value.

toString() public méthode

Output a human readable description of the recurrence rule.
Since: 2.1.0
public toString ( $date_format ) : string
Résultat string

Property Details

$completions public_oe property

All the dates this recurrence has been marked as completed.
public array $completions
Résultat array

$exceptions public_oe property

All the exceptions from recurrence for this event.
public array $exceptions
Résultat array

$recurCount public_oe property

The number of recurrences.
public int $recurCount
Résultat integer

$recurData public_oe property

Any additional recurrence data.
public int $recurData
Résultat integer

$recurEnd public_oe property

The end date of the recurrence interval.
public Horde_Date $recurEnd
Résultat Horde_Date

$recurInterval public_oe property

The length of time between recurrences. The time unit depends on the recurrence type.
public int $recurInterval
Résultat integer

$recurType public_oe property

The type of recurrence this event follows. RECUR_* constant.
public int $recurType
Résultat integer

$start public_oe property

The start time of the event.
public Horde_Date $start
Résultat Horde_Date