RecurringDowntime Class Reference
RecurringDowntime class.
More...
Detailed Description
RecurringDowntime class.
Used with recurring schedules, inherits from Downtime.
Constructor & Destructor Documentation
RecurringDowntime::__construct |
( |
$ |
model |
) |
|
Provides a helpers for working with recurring downtime.
- Parameters:
-
- Exceptions:
-
Reimplemented from Downtime.
Member Function Documentation
RecurringDowntime::is_excluded |
( |
$ |
target_date |
) |
|
Checks if the given $target_date is excluded.
The input, $target_date, is a NinjaDateTime object or--to simplify testing--a parsable date string, that is compared against an array of ranges or single dates contained in `$this->exclude_days`: ['2019-03-13 to 2019-03-16', '2019-03-13 to 2019-03-18', ...]
- Parameters:
-
| $target_date | mixed NinjaDateTime|str |
- Returns:
- bool
- Exceptions:
-
| Exception | UnexpectedValueException Invalid date-exclusion format |
RecurringDowntime::match_day_interval |
( |
$ |
target_date |
) |
|
Checks if the provided $date's day matches the schedule's stepping.
- Parameters:
-
- Returns:
- bool
- Exceptions:
-
| Exception | UnexpectedValueException |
RecurringDowntime::match_day_of_month |
( |
$ |
target_date |
) |
|
Returns true if the given date matches the relative occurrence of the schedule.
if [target_date] is on [occurrence] [weekday] : return true
- Parameters:
-
- Returns:
- boolean
- Exceptions:
-
| Exception | UnexpectedValueException |
RecurringDowntime::match_month_interval |
( |
$ |
target_date |
) |
|
Checks if the provided $date's month matches the schedule's stepping.
- Parameters:
-
- Returns:
- bool
- Exceptions:
-
| Exception | UnexpectedValueException |
RecurringDowntime::match_week_interval |
( |
$ |
target_date |
) |
|
Checks if the provided $date's week matches the schedule's stepping.
- Parameters:
-
- Returns:
- bool
- Exceptions:
-
| Exception | UnexpectedValueException |
RecurringDowntime::match_year_interval |
( |
$ |
target_date |
) |
|
Checks if the provided $date's year matches the schedule's stepping.
- Parameters:
-
- Returns:
- bool
- Exceptions:
-
| Exception | UnexpectedValueException |
RecurringDowntime::pluck_recurrence |
( |
$ |
key |
) |
|
Plucks values by key from a map.
input: 'day'
recurrence_on: ['day' => 1, 'day' => 2, 'day' => 3]
output: [1, 2, 3]
- Parameters:
-
| $key | string The key to pluck |
- Returns:
- array plucked items
The documentation for this class was generated from the following file: