interface StateInterface (View source)

internal  The StateInterface should only be used by Workflows and Content Moderation.
 

An interface for state value objects.

Revisit the need for this in https://www.drupal.org/node/2902309.

Constants

PLUGIN_FORM_KEY

The key of the state plugin form.

Methods

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.

Details

string id()

Gets the state's ID.

Return Value

string

The state's ID.

string label()

Gets the state's label.

Return Value

string

The state's label.

int weight()

Gets the state's weight.

Return Value

int

The state's weight.

bool canTransitionTo($to_state_id)

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.

getTransitionTo($to_state_id)

No description

Parameters

$to_state_id

TransitionInterface[] getTransitions()

Gets all the possible transition objects for the state.

Return Value

TransitionInterface[]

All the possible transition objects for the state.