abstract class AbstractRepetition implements RepetitionInterface (View source)

Abstract repetition class This class is used to define and match against various time windows.

\@package Concrete\Core\Foundation\Repetition

Properties

protected string $startDate
protected string $endDate
protected bool $startDateAllDay
protected bool $endDateAllDay
protected int $repeatPeriod
protected int[] $repeatPeriodWeekDays
protected int $repeatEveryNum
protected int $repeatMonthBy
protected int $repeatMonthLastWeekday
protected string $repeatPeriodEnd
protected DateTimeZone $timezone

Methods

__construct($timezone = null)

AbstractRepetition constructor.

setTimezone(DateTimeZone $timezone)

No description

getStartDateTimestamp()

Returns the start date/time as a timestamp

getEndDateTimestamp()

No description

bool
isStartDateAllDay()

No description

setStartDateAllDay(bool $start_date_all_day)

Toggle whether start_date is all day.

bool
isEndDateAllDay()

No description

setEndDateAllDay(bool $end_date_all_day)

Toggle whether end_date is all day.

mixed
isActive($now = null)

No description

getTimezone()

No description

array|null
getActiveRange($now = null)

No description

mixed
repeats()

No description

mixed
getRepeatPeriod()

No description

setRepeatPeriod($repeat_period)

No description

mixed
getStartDate()

No description

setStartDate($start_date)

Set the start date.

mixed
getEndDate()

No description

setEndDate($end_date)

Set the end date.

rangeFromTime($start, $end = null)

No description

string
getRepeatPeriodEnd()

No description

mixed
setRepeatPeriodEnd($repeat_period_end)

No description

int
getRepeatEveryNum()

No description

mixed
setRepeatEveryNum($repeat_every_num)

No description

mixed
getRepeatPeriodWeekDays()

No description

mixed
setRepeatPeriodWeekDays($repeat_period_week_days)

No description

int
getRepeatMonthBy()

No description

mixed
setRepeatMonthBy(int $repeat_month_by)

No description

mixed
getTextRepresentation()

No description

__toString()

No description

getRepeatPeriodEveryNum() deprecated

This method is deprecated, use getRepeatEveryNum.

int
getRepeatMonthLastWeekday()

No description

setRepeatMonthLastWeekday(int $repeatMonthLastWeekday)

No description

array[]
activeRangesBetween(int $start, int $end)

No description

getDayString($day)

No description

dateDiffNoDST(DateTime $from, DateTime $to)

Returns the difference between two DateTime objects without considering DST changes.

jsonSerialize()

No description

Details

__construct($timezone = null)

AbstractRepetition constructor.

Parameters

$timezone

string | \DateTimeZone

setTimezone(DateTimeZone $timezone)

No description

Parameters

DateTimeZone $timezone

getStartDateTimestamp()

Returns the start date/time as a timestamp

getEndDateTimestamp()

No description

bool isStartDateAllDay()

No description

Return Value

bool

setStartDateAllDay(bool $start_date_all_day)

Toggle whether start_date is all day.

Parameters

bool $start_date_all_day

bool isEndDateAllDay()

No description

Return Value

bool

setEndDateAllDay(bool $end_date_all_day)

Toggle whether end_date is all day.

Parameters

bool $end_date_all_day

mixed isActive($now = null)

No description

Parameters

$now

Return Value

mixed

getTimezone()

No description

array|null getActiveRange($now = null)

No description

Parameters

$now

Return Value

array|null

Returns a list [ start, end ] or null if miss

mixed repeats()

No description

Return Value

mixed

mixed getRepeatPeriod()

No description

Return Value

mixed

setRepeatPeriod($repeat_period)

No description

Parameters

$repeat_period

mixed getStartDate()

No description

Return Value

mixed

setStartDate($start_date)

Set the start date.

Parameters

$start_date

mixed getEndDate()

No description

Return Value

mixed

setEndDate($end_date)

Set the end date.

Parameters

$end_date

protected rangeFromTime($start, $end = null)

No description

Parameters

$start
$end

string getRepeatPeriodEnd()

No description

Return Value

string

mixed setRepeatPeriodEnd($repeat_period_end)

No description

Parameters

$repeat_period_end

Return Value

mixed

int getRepeatEveryNum()

No description

Return Value

int

mixed setRepeatEveryNum($repeat_every_num)

No description

Parameters

$repeat_every_num

Return Value

mixed

mixed getRepeatPeriodWeekDays()

No description

Return Value

mixed

mixed setRepeatPeriodWeekDays($repeat_period_week_days)

No description

Parameters

$repeat_period_week_days

Return Value

mixed

int getRepeatMonthBy()

No description

Return Value

int

self::MONTHLYREPEAT* enum [ ::MONTHLY_REPEAT_WEEKLY | ::MONTHLY_REPEAT_MONTHLY ]

mixed setRepeatMonthBy(int $repeat_month_by)

No description

Parameters

int $repeat_month_by

[ ::MONTHLY_REPEAT_WEEKLY | ::MONTHLY_REPEAT_MONTHLY ]

Return Value

mixed

mixed getTextRepresentation()

No description

Return Value

mixed

__toString()

No description

getRepeatPeriodEveryNum() deprecated

deprecated

This method is deprecated, use getRepeatEveryNum.

int getRepeatMonthLastWeekday()

No description

Return Value

int

The week day number

setRepeatMonthLastWeekday(int $repeatMonthLastWeekday)

No description

Parameters

int $repeatMonthLastWeekday

array[] activeRangesBetween(int $start, int $end)

No description

Parameters

int $start
int $end

Return Value

array[]

protected getDayString($day)

No description

Parameters

$day

protected DateInterval dateDiffNoDST(DateTime $from, DateTime $to)

Returns the difference between two DateTime objects without considering DST changes.

Parameters

DateTime $from
DateTime $to

Return Value

DateInterval

jsonSerialize()

No description