public function TransitionSet::trim in Lightning Workflow 8.2
Same name and namespace in other branches
- 8.3 modules/lightning_scheduler/src/TransitionSet.php \Drupal\lightning_scheduler\TransitionSet::trim()
Removes all transitions older than a given date and time.
Parameters
\Drupal\Core\Datetime\DrupalDateTime $until: The date and time older than which all transitions will be removed.
File
- modules/
lightning_scheduler/ src/ TransitionSet.php, line 120
Class
Namespace
Drupal\lightning_schedulerCode
public function trim(DrupalDateTime $until) {
$until = $until
->getTimestamp();
while (count($this->dateList) > 0 && $this->dateList[0]->date
->getTimestamp() < $until) {
$this->dateList
->removeItem(0);
$this->stateList
->removeItem(0);
}
}