Skip to content

Sabre VObject Recur RDateIterator

Evert Pot edited this page Sep 1, 2014 · 2 revisions

Sabre\VObject\Recur\RDateIterator

RRuleParser

This class receives an RRULE string, and allows you to iterate to get a list of dates in that recurrence.

For instance, passing: FREQ=DAILY;LIMIT=5 will cause the iterator to contain 5 items, one for each day.

  • Class name: RDateIterator
  • Namespace: Sabre\VObject\Recur
  • This class implements: Iterator

Properties

$startDate

protected \DateTime $startDate

The reference start date/time for the rrule.

All calculations are based on this initial date.

  • Visibility: protected

$currentDate

protected \DateTime $currentDate

The date of the current iteration. You can get this by calling ->current().

  • Visibility: protected

$counter

protected integer $counter

The current item in the list.

You can get this number with the key() method.

  • Visibility: protected

Methods

__construct

mixed Sabre\VObject\Recur\RDateIterator::__construct(string|array $rrule, \DateTime $start)

Creates the Iterator.

  • Visibility: public

Arguments

  • $rrule string|array
  • $start DateTime

current

mixed Sabre\VObject\Recur\RDateIterator::current()
  • Visibility: public

key

integer Sabre\VObject\Recur\RDateIterator::key()

Returns the current item number.

  • Visibility: public

valid

boolean Sabre\VObject\Recur\RDateIterator::valid()

Returns whether the current item is a valid item for the recurrence iterator.

  • Visibility: public

rewind

void Sabre\VObject\Recur\RDateIterator::rewind()

Resets the iterator.

  • Visibility: public

next

void Sabre\VObject\Recur\RDateIterator::next()

Goes on to the next iteration.

  • Visibility: public

isInfinite

boolean Sabre\VObject\Recur\RDateIterator::isInfinite()

Returns true if this recurring event never ends.

  • Visibility: public

fastForward

void Sabre\VObject\Recur\RDateIterator::fastForward(\DateTime $dt)

This method allows you to quickly go to the next occurrence after the specified date.

  • Visibility: public

Arguments

  • $dt DateTime

parseRDate

void Sabre\VObject\Recur\RDateIterator::parseRDate($rdate)

This method receives a string from an RRULE property, and populates this class with all the values.

  • Visibility: protected

Arguments

  • $rdate mixed
Clone this wiki locally