ExperimentSchedule
Rasuvaeff\Yii3AbTestingDb\ExperimentSchedule
Class · rasuvaeff/yii3-ab-testing-db · Source
When an experiment is meant to run, as an operational fact.
Deliberately not part of the runtime projection: isActiveAt() is a planning question, and answering it during assignment would make the served variant depend on wall-clock time in a way the deterministic hash never intends. The provider still reads the enabled flag; a scheduler or an operator flips that flag based on this.
Both bounds are optional: an open start means "already begun", an open end means "runs until stopped".
Constructor
php
new ExperimentSchedule(
?DateTimeImmutable $startsAt = null,
?DateTimeImmutable $endsAt = null,
)Properties
| Property | Type | Readonly | Description |
|---|---|---|---|
startsAt | ?DateTimeImmutable | yes | |
endsAt | ?DateTimeImmutable | yes |
Methods
open()
php
static open(): selfisActiveAt()
php
isActiveAt(DateTimeImmutable $moment): boolWhether the schedule covers the given instant. The bounds are inclusive at the start and exclusive at the end, so two back-to-back schedules never both claim the same moment.