State
class State implements StateInterface (View source)
A value object representing a workflow state.
Properties
| protected WorkflowTypeInterface | $workflow | The workflow the state is attached to. |
|
| protected string | $id | The state's ID. |
|
| protected string | $label | The state's label. |
|
| protected int | $weight | The state's weight. |
Methods
__construct(WorkflowTypeInterface $workflow, string $id, string $label, int $weight = 0)
State constructor.
string
id()
Gets the state's ID.
string
label()
Gets the state's label.
int
weight()
Gets the state's weight.
bool
canTransitionTo($to_state_id)
Determines if the state can transition to the provided state ID.
getTransitionTo($to_state_id)
No description
getTransitions()
Gets all the possible transition objects for the state.
static string
Details
__construct(WorkflowTypeInterface $workflow, string $id, string $label, int $weight = 0)
State constructor.
string
id()
Gets the state's ID.
string
label()
Gets the state's label.
int
weight()
Gets the state's weight.
bool
canTransitionTo($to_state_id)
Determines if the state can transition to the provided state ID.
getTransitionTo($to_state_id)
No description
TransitionInterface[]
getTransitions()
Gets all the possible transition objects for the state.
static string
labelCallback(StateInterface $state)
Helper method to convert a State value object to a label.