|
static | getPriorities () |
|
static | describePriority ($priority) |
|
static | tableScheme ($db_table) |
|
static | expireTableScheme () |
|
static | exists ($id) |
|
static | countBySql ($sql= '1', $params=[]) |
|
static | create ($data) |
|
static | buildExisting ($data) |
|
static | import ($data) |
|
static | findBySQL ($sql, $params=[]) |
|
static | findOneBySQL ($where, $params=[]) |
|
static | findThru ($foreign_key_value, $options) |
|
static | findEachBySQL ($callable, $sql, $params=[]) |
|
static | findMany ($pks=[], $order= '', $order_params=[]) |
|
static | findEachMany ($callable, $pks=[], $order= '', $order_params=[]) |
|
static | findAndMapBySQL ($callable, $where, $params=[]) |
|
static | findAndMapMany ($callable, $pks=[], $order= '', $order_params=[]) |
|
static | deleteBySQL ($where, $params=[]) |
|
static | toObject ($id_or_object) |
|
static | __callStatic ($name, $arguments) |
|
Activates this schedule.
- Returns
- CronjobSchedule Returns itself to allow chaining
calculateNextExecution |
( |
|
$now = null | ) |
|
Calculates the next execution for this schedule.
For schedules of type 'once' the check solely tests whether the timestamp has already passed and will return false in that case. Otherwise the defined timestamp will be returned.
For schedules of type 'periodic' the next execution is calculated by increasing the current timestamp and testing whether all conditions match. This is not the best method to test and should be optimized sooner or later.
- Parameters
-
mixed | $now | Defines the temporal fix point |
- Returns
- int Timestamp of calculated next execution
- Exceptions
-
RuntimeException | When calculation takes too long (you should check the conditions for validity in that case) |
cbJsonifyParameters |
( |
|
$type | ) |
|
|
protected |
static configure |
( |
|
$config = [] | ) |
|
|
staticprotected |
Deactivates this schedule.
- Returns
- CronjobSchedule Returns itself to allow chaining
static describePriority |
( |
|
$priority | ) |
|
|
static |
Maps a priority value to it's localized label.
- Parameters
-
String | $priority | Priority value |
- Returns
- String The localized label
- Exceptions
-
RuntimeException | when an unknown priority value is passed |
execute |
( |
|
$force = false | ) |
|
Executes this schedule.
- Parameters
-
bool | $force | Pass true to force execution of the schedule even if it's not activated |
- Returns
- mixed The result of the execution
- Exceptions
-
RuntimeException | When either the schedule or the according is not activated |
Returns a mapped version of the priorities (key = priority value, value = localized priority label).
- Returns
- Array The mapped priorities
replaces title with task name if title is empty.
- Returns
- string the title or the task name
shouldExecute |
( |
|
$now = null | ) |
|
Determines whether the schedule should execute given the provided timestamp.
- Parameters
-
mixed | $now | Defines the temporal fix point |
- Returns
- bool Whether the schedule should execute or not.
Stores the schedule in database. Will bail out with an exception if the provided task does not exists. Will also nullify the title if it matches the task name (see CronjobSchedule::getTitle()).
- Returns
- CronjobSchedule Returns itself to allow chaining
testTimestamp |
( |
|
$timestamp, |
|
|
|
$condition, |
|
|
|
$format |
|
) |
| |
|
protected |
Tests a timestamp against the passed condition.
- Parameters
-
int | $timestamp | The timestamp to test |
mixed | $condition | Can be either null for "don't care", a positive number for an exact moment or a negative number for a repeating moment |
String | $format | Format for date() to extract a portion of the timestamp |
const PRIORITY_HIGH = 'high' |
const PRIORITY_LOW = 'low' |
const PRIORITY_NORMAL = 'normal' |
The documentation for this class was generated from the following file: