You are here

public function TransitionSet::__construct in Lightning Workflow 8.2

Same name and namespace in other branches
  1. 8.3 modules/lightning_scheduler/src/TransitionSet.php \Drupal\lightning_scheduler\TransitionSet::__construct()

TransitionSet constructor.

Parameters

\Drupal\datetime\Plugin\Field\FieldType\DateTimeFieldItemList $date_list: A set of scheduled transition dates for an entity.

\Drupal\Core\Field\FieldItemListInterface $state_list: A set of scheduled workflow states for an entity.

Throws

\InvalidArgumentException if the date list and state list are not of equal length.

File

modules/lightning_scheduler/src/TransitionSet.php, line 37

Class

TransitionSet

Namespace

Drupal\lightning_scheduler

Code

public function __construct(DateTimeFieldItemList $date_list, FieldItemListInterface $state_list) {
  if (count($date_list) !== count($state_list)) {
    throw new \InvalidArgumentException('Transition sets must have equal-length sets of dates and workflow states.');
  }
  $this->dateList = $date_list;
  $this->stateList = $state_list;
}