classRecurringSchedule
final class RecurringSchedule
implements Schedule
uses Snapshot
Public API: explicitly declared with
@visibility public.The schedule EVERY quantity unit [STARTS timestamp] [ENDS timestamp]: the event runs repeatedly.
Source: https://dev.mysql.com/doc/refman/8.4/en/create-event.html.
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE EVENT e ON SCHEDULE EVERY 2 HOUR STARTS CURRENT_TIMESTAMP DO SELECT 1');
[$create->statement->schedule->unit, $create->statement->schedule->ends] // => [\SqlSemantics\Platform\MySql\Statement\Expression\IntervalUnit::Hour, null]Properties§
public Scalar $quantitypublic IntervalUnit $unitpublic Scalar|null $starts = nullpublic Scalar|null $ends = nullMethods§
public function __construct(
public Scalar $quantity,
public IntervalUnit $unit,
public Scalar|null $starts = null,
public Scalar|null $ends = null,
)Parameters
$quantity | Scalar | The length of the interval between two runs |
$unit | IntervalUnit | The unit of the interval |
$starts | Scalar|null | The time of the first run, when written |
$ends | Scalar|null | The time after which the event no longer runs, when written |
public function deriveSchedule(Derivation $derivation, Environment $environment): voidDerives the quantity and the time expressions.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 1
- method-call Derivation::scalar() line 43
public function render(Output $out): voidWrites EVERY, the interval and the STARTS and ENDS clauses.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 57
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.