class Transition implements TransitionInterface (View source)

A transition value object that describes the transition between states.

Properties

protected WorkflowTypeInterface $workflow

The workflow that this transition is attached to.

protected string $id

The transition's ID.

protected string $label

The transition's label.

protected string[] $fromStateIds

The transition's from state IDs.

protected string $toStateId

The transition's to state ID.

protected int $weight

The transition's weight.

Methods

__construct(WorkflowTypeInterface $workflow, string $id, string $label, array $from_state_ids, string $to_state_id, int $weight = 0)

Transition constructor.

string
id()

Gets the transition's ID.

string
label()

Gets the transition's label.

from()

Gets the transition's from states.

to()

Gets the transition's to state.

string
weight()

Gets the transition's weight.

Details

__construct(WorkflowTypeInterface $workflow, string $id, string $label, array $from_state_ids, string $to_state_id, int $weight = 0)

Transition constructor.

Parameters

WorkflowTypeInterface $workflow

The workflow the state is attached to.

string $id

The transition's ID.

string $label

The transition's label.

array $from_state_ids

A list of from state IDs.

string $to_state_id

The to state ID.

int $weight

(optional) The transition's weight. Defaults to 0.

string id()

Gets the transition's ID.

Return Value

string

The transition's ID.

string label()

Gets the transition's label.

Return Value

string

The transition's label.

StateInterface[] from()

Gets the transition's from states.

Return Value

StateInterface[]

The transition's from states.

StateInterface to()

Gets the transition's to state.

Return Value

StateInterface

The transition's to state.

string weight()

Gets the transition's weight.

Return Value

string

The transition's weight.