class WorkflowTransition in State Machine 8
Defines the class for workflow transitions.
Hierarchy
- class \Drupal\state_machine\Plugin\Workflow\WorkflowTransition
Expanded class hierarchy of WorkflowTransition
6 files declare their use of WorkflowTransition
- FulfillmentGuard.php in tests/
modules/ state_machine_test/ src/ Guard/ FulfillmentGuard.php - GenericGuard.php in tests/
modules/ state_machine_test/ src/ Guard/ GenericGuard.php - GuardInterface.php in src/
Guard/ GuardInterface.php - StateItem.php in src/
Plugin/ Field/ FieldType/ StateItem.php - StateItemInterface.php in src/
Plugin/ Field/ FieldType/ StateItemInterface.php
File
- src/
Plugin/ Workflow/ WorkflowTransition.php, line 8
Namespace
Drupal\state_machine\Plugin\WorkflowView source
class WorkflowTransition {
/**
* The transition ID.
*
* @var string
*/
protected $id;
/**
* The transition label.
*
* @var string
*/
protected $label;
/**
* The "from" states.
*
* @var \Drupal\state_machine\Plugin\Workflow\WorkflowState[]
*/
protected $fromStates;
/**
* The "to" state.
*
* @var \Drupal\state_machine\Plugin\Workflow\WorkflowState
*/
protected $toState;
/**
* Constructs a new WorkflowTransition object.
*
* @param string $id
* The transition ID.
* @param string $label
* The transition label.
* @param \Drupal\state_machine\Plugin\Workflow\WorkflowState[] $from_states
* The "from" states.
* @param \Drupal\state_machine\Plugin\Workflow\WorkflowState $to_state
* The "to" state.
*/
public function __construct($id, $label, array $from_states, WorkflowState $to_state) {
$this->id = $id;
$this->label = $label;
$this->fromStates = $from_states;
$this->toState = $to_state;
}
/**
* Gets the ID.
*
* @return string
* The ID.
*/
public function getId() {
return $this->id;
}
/**
* Gets the translated label.
*
* @return string
* The translated label.
*/
public function getLabel() {
return (string) t($this->label, [], [
'context' => 'workflow transition',
]);
}
/**
* Gets the "from" states.
*
* @return \Drupal\state_machine\Plugin\Workflow\WorkflowState[]
* The "from" states.
*/
public function getFromStates() {
return $this->fromStates;
}
/**
* Gets the "to" state.
*
* @return \Drupal\state_machine\Plugin\Workflow\WorkflowState
* The "to" state.
*/
public function getToState() {
return $this->toState;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
WorkflowTransition:: |
protected | property | The "from" states. | |
WorkflowTransition:: |
protected | property | The transition ID. | |
WorkflowTransition:: |
protected | property | The transition label. | |
WorkflowTransition:: |
protected | property | The "to" state. | |
WorkflowTransition:: |
public | function | Gets the "from" states. | |
WorkflowTransition:: |
public | function | Gets the ID. | |
WorkflowTransition:: |
public | function | Gets the translated label. | |
WorkflowTransition:: |
public | function | Gets the "to" state. | |
WorkflowTransition:: |
public | function | Constructs a new WorkflowTransition object. |