You are here

public function WorkflowTransitionEvent::getFromState in State Machine 8

Gets the "from" state.

Return value

\Drupal\state_machine\Plugin\Workflow\WorkflowState The "from" state.

Deprecated

in state_machine:8.x-1.0-rc1 and is removed from state_machine:8.x-2.0. Use $this->getField()->getOriginalId() instead.

See also

https://www.drupal.org/node/2982709

File

src/Event/WorkflowTransitionEvent.php, line 124

Class

WorkflowTransitionEvent
Defines the workflow transition event.

Namespace

Drupal\state_machine\Event

Code

public function getFromState() {
  $original_id = $this
    ->getField()
    ->getOriginalId();
  return $this->workflow
    ->getState($original_id);
}