PHP Класс RRule\RSet

Наследование: implements rrule\RRuleInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cache Cache for all the occurrences
$current
$exdates List of EXDATE (single dates to be excluded)
$exlist_heap
$exlist_iterator
$exrules List of EXRULES (single rules to be excluded)
$infinite Cache for the finite status of the RSet
$key
$rdates List of RDATE (single dates)
$rlist_heap cache variables
$rlist_iterator
$rrules List of RRULE
$total Cache for the total number of occurrences

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

Метод Описание
__construct ( ) Constructor
addDate ( mixed $date ) Add a RDATE (renamed Date for simplicy, since we don't support full RDATE syntax at the moment)
addExDate ( mixed $date ) Add a EXDATE
addExRule ( mixed $rrule ) Add a RRule with exclusion rules.
addRRule ( mixed $rrule ) Add a RRule (or another RSet)
clearCache ( ) Clear the cache.
count ( ) : integer Returns the number of recurrences in this set. It will have go through the whole recurrence, if this hasn't been done before, which introduces a performance penality.
current ( )
getDates ( ) : array Return the RDATE(s) contained in this set
getExDates ( ) : array Return the EXDATE(s) contained in this set
getExRules ( ) : array Return the EXRULE(s) contained in this set
getOccurrences ( ) : array Return all the occurrences in an array of \DateTime.
getOccurrencesBetween ( mixed $begin, mixed $end ) : array Return all the ocurrences after a date, before a date, or between two dates.
getRRules ( ) : array Return the RRULE(s) contained in this set
isFinite ( ) : boolean Return true if the rrule has an end condition, false otherwise
isInfinite ( ) : boolean Return true if the rrule has no end condition (infite)
key ( )
next ( )
occursAt ( mixed $date ) : boolean Return true if $date is an occurrence.
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
rewind ( )
valid ( )

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

Метод Описание
iterate ( $reset = false ) : DateTime | null This method will iterate over a bunch of different iterators (rrules and arrays), keeping the results *in order*, while never attempting to merge or sort anything in memory. It can combine both finite and infinite rrule.

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

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

Constructor
public __construct ( )

addDate() публичный Метод

Add a RDATE (renamed Date for simplicy, since we don't support full RDATE syntax at the moment)
public addDate ( mixed $date )
$date mixed a valid date representation or a \DateTime object

addExDate() публичный Метод

Add a EXDATE
public addExDate ( mixed $date )
$date mixed a valid date representation or a \DateTime object

addExRule() публичный Метод

In RFC 2445 but deprecated in RFC 5545
public addExRule ( mixed $rrule )
$rrule mixed an instance of RRuleInterface or something that can be transformed into a RRule (string or array)

addRRule() публичный Метод

Add a RRule (or another RSet)
public addRRule ( mixed $rrule )
$rrule mixed an instance of RRuleInterface or something that can be transformed into a RRule (string or array)

clearCache() публичный Метод

Do NOT use while the class is iterating.
public clearCache ( )

count() публичный Метод

Returns the number of recurrences in this set. It will have go through the whole recurrence, if this hasn't been done before, which introduces a performance penality.
public count ( ) : integer
Результат integer

current() публичный Метод

public current ( )

getDates() публичный Метод

Return the RDATE(s) contained in this set
public getDates ( ) : array
Результат array Array of \DateTime

getExDates() публичный Метод

Return the EXDATE(s) contained in this set
public getExDates ( ) : array
Результат array Array of \DateTime

getExRules() публичный Метод

Return the EXRULE(s) contained in this set
public getExRules ( ) : array
Результат array Array of RRule

getOccurrences() публичный Метод

Return all the occurrences in an array of \DateTime.
public getOccurrences ( ) : array
Результат array An array of \DateTime objects

getOccurrencesBetween() публичный Метод

Return all the ocurrences after a date, before a date, or between two dates.
public getOccurrencesBetween ( mixed $begin, mixed $end ) : array
$begin mixed Can be null to return all occurrences before $end
$end mixed Can be null to return all occurrences after $begin
Результат array An array of \DateTime objects

getRRules() публичный Метод

Return the RRULE(s) contained in this set
public getRRules ( ) : array
Результат array Array of RRule

isFinite() публичный Метод

Return true if the rrule has an end condition, false otherwise
public isFinite ( ) : boolean
Результат boolean

isInfinite() публичный Метод

Return true if the rrule has no end condition (infite)
public isInfinite ( ) : boolean
Результат boolean

iterate() защищенный Метод

What we need to do it to build two heaps: rlist and exlist Each heap contains multiple iterators (either RRule or ArrayIterator) At each step of the loop, it calls all of the iterators to generate a new item, and stores them in the heap, that keeps them in order. This is made slightly more complicated because this method is a generator.
protected iterate ( $reset = false ) : DateTime | null
$reset (bool) Whether to restart the iteration, or keep going
Результат DateTime | null

key() публичный Метод

public key ( )

next() публичный Метод

public next ( )

occursAt() публичный Метод

Return true if $date is an occurrence.
public occursAt ( mixed $date ) : boolean
$date mixed
Результат boolean

offsetExists() публичный Метод

public offsetExists ( $offset )

offsetGet() публичный Метод

public offsetGet ( $offset )

offsetSet() публичный Метод

public offsetSet ( $offset, $value )

offsetUnset() публичный Метод

public offsetUnset ( $offset )

rewind() публичный Метод

public rewind ( )

valid() публичный Метод

public valid ( )

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

$cache защищенное свойство

Cache for all the occurrences
protected $cache

$current защищенное свойство

protected $current

$exdates защищенное свойство

List of EXDATE (single dates to be excluded)
protected $exdates

$exlist_heap защищенное свойство

protected $exlist_heap

$exlist_iterator защищенное свойство

protected $exlist_iterator

$exrules защищенное свойство

List of EXRULES (single rules to be excluded)
protected $exrules

$infinite защищенное свойство

Cache for the finite status of the RSet
protected $infinite

$key защищенное свойство

protected $key

$rdates защищенное свойство

List of RDATE (single dates)
protected $rdates

$rlist_heap защищенное свойство

cache variables
protected $rlist_heap

$rlist_iterator защищенное свойство

protected $rlist_iterator

$rrules защищенное свойство

List of RRULE
protected $rrules

$total защищенное свойство

Cache for the total number of occurrences
protected $total