Documentation

RRule
in package
implements Stringable

Represents a recurrence rule from RFC 5545.

Table of Contents

Interfaces

Stringable

Constants

FREQUENCIES  = ['YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY', 'MINUTELY', 'SECONDLY']
UTC_SYNONYMS  = ['UTC', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'UCT', 'Universal', 'Zulu', 'Z', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT-0', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/Universal', 'Etc/UTC', 'Etc/Zulu']
WEEKDAYS  = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']

Properties

$byday  : array<string|int, mixed>
$byhour  : array<string|int, mixed>
$byminute  : array<string|int, mixed>
$bymonth  : array<string|int, mixed>
$bymonthday  : array<string|int, mixed>
$bysecond  : array<string|int, mixed>
$bysetpos  : array<string|int, mixed>
$byweekno  : array<string|int, mixed>
$byyearday  : array<string|int, mixed>
$count  : int
$freq  : string
$interval  : int
$until  : DateTimeInterface
$until_type  : int
$wkst  : string

Methods

__construct()  : mixed
Constructor.
__toString()  : string
Allows this object to be handled like a string.
getDescription()  : string
Builds a human-readable description of this RRule.
getDescriptionByDay()  : void
Day of week (e.g. "on Monday", "on Monday and Tuesday", "on the 3rd Monday")
getDescriptionByMonth()  : void
Months (e.g. "in January", "in March and April")
getDescriptionByMonthDay()  : void
Day of month (e.g. "on the 3rd day of the month")
getDescriptionBySetPos()  : string
Gets the description with BYSETPOS considerations.
getDescriptionByTime()  : void
Hour, minute, and second.
getDescriptionByWeekNo()  : void
Week number (e.g. "in the 3rd week of the year")
getDescriptionByYearDay()  : void
Day of year (e.g. "on the 3rd day of the year")
getDescriptionNormal()  : string
Gets the description without any BYSETPOS considerations.

Constants

FREQUENCIES

public array<string|int, mixed> FREQUENCIES = ['YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY', 'MINUTELY', 'SECONDLY']

Recurrence frequencies defined in RFC 5545.

UTC_SYNONYMS

public array<string|int, mixed> UTC_SYNONYMS = ['UTC', 'GMT', 'GMT+0', 'GMT-0', 'GMT0', 'Greenwich', 'UCT', 'Universal', 'Zulu', 'Z', 'Etc/GMT', 'Etc/GMT+0', 'Etc/GMT-0', 'Etc/GMT0', 'Etc/Greenwich', 'Etc/UCT', 'Etc/Universal', 'Etc/UTC', 'Etc/Zulu']

PHP time zone names that are synonymous with UTC.

WEEKDAYS

public array<string|int, mixed> WEEKDAYS = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']

Weekday abbreviations defined in RFC 5545.

The order of the elements matters. Do not change it.

Properties

$byday

public array<string|int, mixed> $byday

Values extracted from the recurrence rule's BYDAY part, if present.

$byhour

public array<string|int, mixed> $byhour

Values extracted from the recurrence rule's BYHOUR part, if present.

$byminute

public array<string|int, mixed> $byminute

Values extracted from the recurrence rule's BYMINUTE part, if present.

$bymonth

public array<string|int, mixed> $bymonth

Values extracted from the recurrence rule's BYMONTH part, if present.

$bymonthday

public array<string|int, mixed> $bymonthday

Values extracted from the recurrence rule's BYMONTHDAY part, if present.

$bysecond

public array<string|int, mixed> $bysecond

Values extracted from the recurrence rule's BYSECOND part, if present.

$bysetpos

public array<string|int, mixed> $bysetpos

Values extracted from the recurrence rule's BYSETPOS part, if present.

$byweekno

public array<string|int, mixed> $byweekno

Values extracted from the recurrence rule's BYWEEKNO part, if present.

$byyearday

public array<string|int, mixed> $byyearday

Values extracted from the recurrence rule's BYYEARDAY part, if present.

$count

public int $count

The value of the recurrence rule's COUNT part, if present.

$freq

public string $freq

The base frequency of this recurrence rule.

Must be one of the values of self::FREQUENCIES.

$interval

public int $interval = 1

The value of the recurrence rule's INTERVAL part.

Defaults to 1 if the INTERVAL part is not present.

$until

public DateTimeInterface $until

When the recurrence ends.

$until_type

public int $until_type

Whether UNTIL is a normal, floating, or all day event type.

Normal means it has a date, a time, and a time zone. Floating means it has a date and a time, but no time zone. All day means it has a date, but neither a time nor a time zone.

Value must be one of the RecurrenceIterator::TYPE_* constants

$wkst

public string $wkst = 'MO'

The value of the recurrence rule's WKST part, if present.

Methods

__construct()

Constructor.

public __construct(string $rrule) : mixed
Parameters
$rrule : string

An RRule string.

__toString()

Allows this object to be handled like a string.

public __toString() : string
Return values
string

getDescription()

Builds a human-readable description of this RRule.

public getDescription(EventOccurrence $occurrence[, bool|null $show_start = null ]) : string
Parameters
$occurrence : EventOccurrence

The event occurrence that is currently being viewed.

$show_start : bool|null = null

Whether to show the start date in the description. If not set, will be determined automatically.

Return values
string

getDescriptionByDay()

Day of week (e.g. "on Monday", "on Monday and Tuesday", "on the 3rd Monday")

protected getDescriptionByDay(DateTimeInterface $start, array<string|int, mixed> &$description) : void
Parameters
$start : DateTimeInterface
$description : array<string|int, mixed>

getDescriptionByMonth()

Months (e.g. "in January", "in March and April")

protected getDescriptionByMonth(DateTimeInterface $start, array<string|int, mixed> &$description) : void
Parameters
$start : DateTimeInterface
$description : array<string|int, mixed>

getDescriptionByMonthDay()

Day of month (e.g. "on the 3rd day of the month")

protected getDescriptionByMonthDay(DateTimeInterface $start, array<string|int, mixed> &$description) : void
Parameters
$start : DateTimeInterface
$description : array<string|int, mixed>

getDescriptionBySetPos()

Gets the description with BYSETPOS considerations.

protected getDescriptionBySetPos(DateTimeInterface $start) : string
Parameters
$start : DateTimeInterface
Return values
string

getDescriptionByTime()

Hour, minute, and second.

protected getDescriptionByTime(DateTimeInterface $start, array<string|int, mixed> &$description) : void
Parameters
$start : DateTimeInterface
$description : array<string|int, mixed>

getDescriptionByWeekNo()

Week number (e.g. "in the 3rd week of the year")

protected getDescriptionByWeekNo(DateTimeInterface $start, array<string|int, mixed> &$description) : void
Parameters
$start : DateTimeInterface
$description : array<string|int, mixed>

getDescriptionByYearDay()

Day of year (e.g. "on the 3rd day of the year")

protected getDescriptionByYearDay(DateTimeInterface $start, array<string|int, mixed> &$description) : void
Parameters
$start : DateTimeInterface
$description : array<string|int, mixed>

getDescriptionNormal()

Gets the description without any BYSETPOS considerations.

protected getDescriptionNormal(DateTimeInterface $start) : string
Parameters
$start : DateTimeInterface
Return values
string

        
On this page

Search results