PHP Класс 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.
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_formatExceptionDate ( string $date, string $format ) : string Returns a correcty formatted exception date for recurring events.

Описание методов

__construct() публичный метод

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

_formatExceptionDate() защищенный метод

Returns a correcty formatted exception date for recurring events.
С версии: 2.1.0
protected _formatExceptionDate ( string $date, string $format ) : string
$date string Exception in the format Ymd.
$format string The format to display in.
Результат string The formatted date and delete link.

addCompletion() публичный метод

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() публичный метод

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() публичный метод

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() публичный метод

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() публичный метод

Parses the recurrence data from a Kolab hash.
public fromKolab ( array $hash ) : boolean
$hash array The hash to convert.
Результат boolean True if the hash seemed valid, false otherwise.

fromRRule10() публичный метод

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

fromRRule20() публичный метод

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

getCompletions() публичный метод

Retrieves all the completions for this event.
public getCompletions ( ) : array
Результат array Array containing the dates of all the completions in YYYYMMDD form.

getExceptions() публичный метод

Retrieves all the exceptions for this event.
public getExceptions ( ) : array
Результат array Array containing the dates of all the exceptions in YYYYMMDD form.

getRecurCount() публичный метод

Retrieves the number of recurrences of this event.
public getRecurCount ( ) : integer
Результат integer The number recurrences.

getRecurEnd() публичный метод

Retrieves the end date of the recurrence interval.
public getRecurEnd ( ) : Horde_Date
Результат Horde_Date The recurrence end.

getRecurInterval() публичный метод

Retrieves the length of time between recurrences of this event.
public getRecurInterval ( ) : integer
Результат integer The number of seconds between recurrences.

getRecurName() публичный метод

Returns a description of this event's recurring type.
public getRecurName ( ) : string
Результат string Human readable recurring type.

getRecurOnDays() публичный метод

Returns the days this event recurs on.
public getRecurOnDays ( ) : integer
Результат integer A mask consisting of Horde_Date::MASK_* constants specifying the day(s) this event recurs on.

getRecurStart() публичный метод

Retrieves the start date of the recurrence interval.
public getRecurStart ( ) : Horde_Date
Результат Horde_Date The recurrence start.

getRecurType() публичный метод

Returns recurrence type of this event.
public getRecurType ( ) : integer
Результат integer A RECUR_* constant.

hasActiveRecurrence() публичный метод

Returns whether this event has any date that matches the recurrence rules and is not an exception.
public hasActiveRecurrence ( ) : boolean
Результат boolean True if an active recurrence exists.

hasCompletion() публичный метод

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.
Результат boolean True if a completion exists for the given date.

hasException() публичный метод

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.
Результат boolean True if an exception exists for the given date.

hasRecurCount() публичный метод

Returns whether this event has a recurrence with a fixed count.
public hasRecurCount ( ) : boolean
Результат boolean True if this recurrence has a fixed count.

hasRecurEnd() публичный метод

Returns whether this event has a recurrence end.
public hasRecurEnd ( ) : boolean
Результат boolean True if this recurrence ends.

hasRecurType() публичный метод

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.
Результат boolean True if the event has the specified recurrence type.

isEqual() публичный метод

The objects are considered equal if the recurrence rules are the same. This does not take any exceptions into account.
С версии: 2.2.0
public isEqual ( Horde_Date_Recurrence $recurrence ) : boolean
$recurrence Horde_Date_Recurrence The recurrence object to check equality to.
Результат boolean True if the recurrence rules are the same.

nextActiveRecurrence() публичный метод

Returns the next active recurrence.
public nextActiveRecurrence ( Horde_Date $afterDate ) : Horde_Date | boolean
$afterDate Horde_Date Return events after this date.
Результат Horde_Date | boolean The date of the next active recurrence or false if the event has no active recurrence after $afterDate.

nextRecurrence() публичный метод

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.
Результат Horde_Date | boolean The date of the next recurrence or false if the event does not recur after $afterDate.

recurOnDay() публичный метод

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.
Результат boolean True if this event recurs on the given day(s).

reset() публичный метод

Resets the class properties.
public reset ( )

setRecurCount() публичный метод

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

setRecurEnd() публичный метод

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

setRecurInterval() публичный метод

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

setRecurOnDay() публичный метод

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() публичный метод

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

setRecurType() публичный метод

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

toJson() публичный метод

Possible properties are: - t: type - i: interval - e: end date - c: count - d: data - co: completions - ex: exceptions
public toJson ( ) : object
Результат object A simple object.

toKolab() публичный метод

Export this object into a Kolab hash.
public toKolab ( ) : array
Результат array The recurrence hash.

toRRule10() публичный метод

Creates a vCalendar 1.0 recurrence rule.
public toRRule10 ( Horde_Icalendar $calendar ) : string
$calendar Horde_Icalendar A Horde_Icalendar object instance.
Результат string A vCalendar 1.0 conform RRULE value.

toRRule20() публичный метод

Creates an iCalendar 2.0 recurrence rule.
public toRRule20 ( Horde_Icalendar $calendar ) : string
$calendar Horde_Icalendar A Horde_Icalendar object instance.
Результат string An iCalendar 2.0 conform RRULE value.

toString() публичный метод

Output a human readable description of the recurrence rule.
С версии: 2.1.0
public toString ( $date_format ) : string
Результат string

Описание свойств

$completions публичное свойство

All the dates this recurrence has been marked as completed.
public array $completions
Результат array

$exceptions публичное свойство

All the exceptions from recurrence for this event.
public array $exceptions
Результат array

$recurCount публичное свойство

The number of recurrences.
public int $recurCount
Результат integer

$recurData публичное свойство

Any additional recurrence data.
public int $recurData
Результат integer

$recurEnd публичное свойство

The end date of the recurrence interval.
public Horde_Date $recurEnd
Результат Horde_Date

$recurInterval публичное свойство

The length of time between recurrences. The time unit depends on the recurrence type.
public int $recurInterval
Результат integer

$recurType публичное свойство

The type of recurrence this event follows. RECUR_* constant.
public int $recurType
Результат integer

$start публичное свойство

The start time of the event.
public Horde_Date $start
Результат Horde_Date