PHP Class Sabre\VObject\Recur\EventIterator

This iterator may loop infinitely in the future, therefore it is important that if you use this class, you set hard limits for the amount of iterations you want to handle. Note that currently there is not full support for the entire iCalendar specification, as it's very complex and contains a lot of permutations that's not yet used very often in software. For the focus has been on features as they actually appear in Calendaring software, but this may well get expanded as needed / on demand The following RRULE properties are supported * UNTIL * INTERVAL * COUNT * FREQ=DAILY * BYDAY * BYHOUR * BYMONTH * FREQ=WEEKLY * BYDAY * BYHOUR * WKST * FREQ=MONTHLY * BYMONTHDAY * BYDAY * BYSETPOS * FREQ=YEARLY * BYMONTH * BYMONTHDAY (only if BYMONTH is also set) * BYDAY (only if BYMONTH is also set) Anything beyond this is 'undefined', which means that it may get ignored, or you may get unexpected results. The effect is that in some applications the specified recurrence may look incorrect, or is missing. The recurrence iterator also does not yet support THISANDFUTURE.
Author: Evert Pot (http://evertpot.com/)
Inheritance: implements Iterator
Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$allDay boolean True if we're iterating an all-day event.
$counter integer Internal event counter
$currentDate DateTime Where we are currently in the iteration process
$eventDuration We use this to calculate the DTEND for subsequent events.
$exceptions array A list of recurrence-id's that are either part of EXDATE, or are overridden.
$masterEvent VEVENT A reference to the main (master) event.
$nextDate DateTime Sometimes we need to temporary store the next date, because an overridden event came before.
$overriddenEvents array List of overridden events.
$overriddenEventsIndex array Key is timestamp, value is the index of the item in the $overriddenEvent property.
$recurIterator Sabre\VObject\Recur\RRuleIterator RRULE parser
$startDate DateTime The very start of the iteration process.
$timeZone DateTimeZone Reference timeZone for floating dates and times.

Méthodes publiques

Méthode Description
__construct ( Sabre\VObject\Component | array $input, string | null $uid = null, DateTimeZone $timeZone = null ) Creates the iterator
current ( ) : DateTime Returns the date for the current position of the iterator.
fastForward ( DateTime $dateTime ) Quickly jump to a date in the future.
getDtEnd ( ) : DateTime This method returns the end date for the current iteration of the event.
getDtStart ( ) : DateTime This method returns the start date for the current iteration of the event.
getEventObject ( ) : Sabre\VObject\Component\VEvent Returns a VEVENT for the current iterations of the event.
isInfinite ( ) : boolean Returns true if this recurring event never ends.
key ( ) : integer Returns the current position of the iterator.
next ( ) : void Advances the iterator with one step.
rewind ( ) Sets the iterator back to the starting point.
valid ( ) : boolean This is called after next, to see if the iterator is still at a valid position, or if it's at the end.

Method Details

__construct() public méthode

There's three ways to set up the iterator. 1. You can pass a VCALENDAR component and a UID. 2. You can pass an array of VEVENTs (all UIDS should match). 3. You can pass a single VEVENT component. Only the second method is recomended. The other 1 and 3 will be removed at some point in the future. The $uid parameter is only required for the first method.
public __construct ( Sabre\VObject\Component | array $input, string | null $uid = null, DateTimeZone $timeZone = null )
$input Sabre\VObject\Component | array
$uid string | null
$timeZone DateTimeZone Reference timezone for floating dates and times.

current() public méthode

Returns the date for the current position of the iterator.
public current ( ) : DateTime
Résultat DateTime

fastForward() public méthode

Quickly jump to a date in the future.
public fastForward ( DateTime $dateTime )
$dateTime DateTime

getDtEnd() public méthode

This method returns the end date for the current iteration of the event.
public getDtEnd ( ) : DateTime
Résultat DateTime

getDtStart() public méthode

This method returns the start date for the current iteration of the event.
public getDtStart ( ) : DateTime
Résultat DateTime

getEventObject() public méthode

This VEVENT will have a recurrence id, and it's DTSTART and DTEND altered.
public getEventObject ( ) : Sabre\VObject\Component\VEvent
Résultat Sabre\VObject\Component\VEvent

isInfinite() public méthode

Returns true if this recurring event never ends.
public isInfinite ( ) : boolean
Résultat boolean

key() public méthode

This is for us simply a 0-based index.
public key ( ) : integer
Résultat integer

next() public méthode

Advances the iterator with one step.
public next ( ) : void
Résultat void

rewind() public méthode

Sets the iterator back to the starting point.
public rewind ( )

valid() public méthode

This is called after next, to see if the iterator is still at a valid position, or if it's at the end.
public valid ( ) : boolean
Résultat boolean

Property Details

$allDay protected_oe property

True if we're iterating an all-day event.
protected bool $allDay
Résultat boolean

$counter protected_oe property

Internal event counter
protected int $counter
Résultat integer

$currentDate protected_oe property

Where we are currently in the iteration process
protected DateTime $currentDate
Résultat DateTime

$eventDuration protected_oe property

We use this to calculate the DTEND for subsequent events.
protected $eventDuration

$exceptions protected_oe property

A list of recurrence-id's that are either part of EXDATE, or are overridden.
protected array $exceptions
Résultat array

$masterEvent protected_oe property

A reference to the main (master) event.
protected VEVENT $masterEvent
Résultat VEVENT

$nextDate protected_oe property

Sometimes we need to temporary store the next date, because an overridden event came before.
protected DateTime $nextDate
Résultat DateTime

$overriddenEvents protected_oe property

List of overridden events.
protected array $overriddenEvents
Résultat array

$overriddenEventsIndex protected_oe property

Key is timestamp, value is the index of the item in the $overriddenEvent property.
protected array $overriddenEventsIndex
Résultat array

$recurIterator protected_oe property

RRULE parser
protected RRuleIterator,Sabre\VObject\Recur $recurIterator
Résultat Sabre\VObject\Recur\RRuleIterator

$startDate protected_oe property

The very start of the iteration process.
protected DateTime $startDate
Résultat DateTime

$timeZone protected_oe property

Reference timeZone for floating dates and times.
protected DateTimeZone $timeZone
Résultat DateTimeZone