You are here

public function State::canTransitionTo in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/workflows/src/State.php \Drupal\workflows\State::canTransitionTo()

Determines if the state can transition to the provided state ID.

Parameters

$to_state_id: The state to transition to.

Return value

bool TRUE if the state can transition to the provided state ID. FALSE, if not.

Overrides StateInterface::canTransitionTo

1 call to State::canTransitionTo()
State::getTransitionTo in core/modules/workflows/src/State.php
Gets the Transition object for the provided state ID.

File

core/modules/workflows/src/State.php, line 81

Class

State
A value object representing a workflow state.

Namespace

Drupal\workflows

Code

public function canTransitionTo($to_state_id) {
  return $this->workflow
    ->hasTransitionFromStateToState($this->id, $to_state_id);
}