You are here

public function TransitionSet::toArray in Lightning Workflow 8.3

Same name and namespace in other branches
  1. 8.2 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 56

Class

TransitionSet
Represents a set of scheduled transitions for a single entity.

Namespace

Drupal\lightning_scheduler

Code

public function toArray() {
  $data = [];
  foreach ($this->dateList as $delta => $item) {
    $key = $item->date
      ->getTimestamp();
    $data[$key] = $this->stateList[$delta]->value;
  }
  ksort($data);
  return $data;
}