protected function StateTransitionValidation::getTransitionsFrom in Workbench Moderation 8
Same name and namespace in other branches
- 8.2 src/StateTransitionValidation.php \Drupal\workbench_moderation\StateTransitionValidation::getTransitionsFrom()
Returns a list of transitions from a given state.
This list is based only on those transitions that exist, not what transitions are legal in a given context.
Parameters
string $state_name: The machine name of the state from which we are transitioning.
Return value
\Drupal\workbench_moderation\Entity\ModerationStateTransition[] Returns array.
1 call to StateTransitionValidation::getTransitionsFrom()
- StateTransitionValidation::getValidTransitions in src/
StateTransitionValidation.php - Gets a list of transitions that are legal for this user on this entity.
File
- src/
StateTransitionValidation.php, line 155
Class
- StateTransitionValidation
- Validates whether a certain state transition is allowed.
Namespace
Drupal\workbench_moderationCode
protected function getTransitionsFrom($state_name) {
$result = $this
->transitionStateQuery()
->condition('stateFrom', $state_name)
->sort('weight')
->execute();
return $this
->transitionStorage()
->loadMultiple($result);
}