You are here

public function Transition::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workflows/src/Transition.php \Drupal\workflows\Transition::__construct()
  2. 10 core/modules/workflows/src/Transition.php \Drupal\workflows\Transition::__construct()

Transition constructor.

Parameters

\Drupal\workflows\WorkflowTypeInterface $workflow: The workflow the state is attached to.

string $id: The transition's ID.

string $label: The transition's label.

array $from_state_ids: A list of from state IDs.

string $to_state_id: The to state ID.

int $weight: (optional) The transition's weight. Defaults to 0.

File

core/modules/workflows/src/Transition.php, line 68

Class

Transition
A transition value object that describes the transition between states.

Namespace

Drupal\workflows

Code

public function __construct(WorkflowTypeInterface $workflow, $id, $label, array $from_state_ids, $to_state_id, $weight = 0) {
  $this->workflow = $workflow;
  $this->id = $id;
  $this->label = $label;
  $this->fromStateIds = $from_state_ids;
  $this->toStateId = $to_state_id;
  $this->weight = $weight;
}