public function TransitionSet::toArray in Lightning Workflow 8.2
Same name and namespace in other branches
- 8.3 modules/lightning_scheduler/src/TransitionSet.php \Drupal\lightning_scheduler\TransitionSet::toArray()
Represents the transition set as a map.
Return value
array The transition set as a flat, sorted map, where the keys are the date and time of the transition, and the values are the targeted workflow state ID.
1 call to TransitionSet::toArray()
- TransitionSet::getExpectedState in modules/
lightning_scheduler/ src/ TransitionSet.php - Returns the expected workflow state for a given date and time.
File
- modules/
lightning_scheduler/ src/ TransitionSet.php, line 53
Class
Namespace
Drupal\lightning_schedulerCode
public function toArray() {
$data = [];
foreach ($this->dateList as $delta => $item) {
$key = $item->date
->getTimestamp();
$data[$key] = $this->stateList[$delta]->value;
}
ksort($data);
return $data;
}