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)

Parameters

DateTimeZone $timezone

getStartDateTimestamp()

Returns the start date/time as a timestamp

getEndDateTimestamp()

bool isStartDateAllDay()

Return Value

bool

setStartDateAllDay(bool $start_date_all_day)

Toggle whether start_date is all day.

Parameters

bool $start_date_all_day

bool isEndDateAllDay()

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)

Parameters

$now

Return Value

mixed

getTimezone()

array|null getActiveRange($now = null)

Parameters

$now

Return Value

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

mixed repeats()

Return Value

mixed

mixed getRepeatPeriod()

Return Value

mixed

setRepeatPeriod($repeat_period)

Parameters

$repeat_period

mixed getStartDate()

Return Value

mixed

setStartDate($start_date)

Set the start date.

Parameters

$start_date

mixed getEndDate()

Return Value

mixed

setEndDate($end_date)

Set the end date.

Parameters

$end_date

protected rangeFromTime($start, $end = null)

Parameters

$start
$end

string getRepeatPeriodEnd()

Return Value

string

mixed setRepeatPeriodEnd($repeat_period_end)

Parameters

$repeat_period_end

Return Value

mixed

int getRepeatEveryNum()

Return Value

int

mixed setRepeatEveryNum($repeat_every_num)

Parameters

$repeat_every_num

Return Value

mixed

mixed getRepeatPeriodWeekDays()

Return Value

mixed

mixed setRepeatPeriodWeekDays($repeat_period_week_days)

Parameters

$repeat_period_week_days

Return Value

mixed

int getRepeatMonthBy()

Return Value

int self::MONTHLY_REPEAT_* enum [ ::MONTHLY_REPEAT_WEEKLY | ::MONTHLY_REPEAT_MONTHLY ]

mixed setRepeatMonthBy(int $repeat_month_by)

Parameters

int $repeat_month_by [ ::MONTHLY_REPEAT_WEEKLY | ::MONTHLY_REPEAT_MONTHLY ]

Return Value

mixed

mixed getTextRepresentation()

Return Value

mixed

__toString()

getRepeatPeriodEveryNum() deprecated

deprecated

This method is deprecated, use getRepeatEveryNum.

int getRepeatMonthLastWeekday()

Return Value

int The week day number

setRepeatMonthLastWeekday(int $repeatMonthLastWeekday)

Parameters

int $repeatMonthLastWeekday

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

Parameters

int $start
int $end

Return Value

array[]

protected getDayString($day)

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()