class ContentModerationState implements StateInterface (View source)

A value object representing a workflow state for content moderation.

Properties

protected StateInterface $state

The vanilla state object from the Workflow module.

protected bool $published

If entities should be published if in this state.

protected bool $defaultRevision

If entities should be the default revision if in this state.

Methods

__construct(StateInterface $state, bool $published = FALSE, bool $default_revision = FALSE)

ContentModerationState constructor.

bool
isPublishedState()

Determines if entities should be published if in this state.

bool
isDefaultRevisionState()

Determines if entities should be the default revision if in this state.

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

__construct(StateInterface $state, bool $published = FALSE, bool $default_revision = FALSE)

ContentModerationState constructor.

Decorates state objects to add methods to determine if an entity should be published or made the default revision.

Parameters

StateInterface $state

The vanilla state object from the Workflow module.

bool $published

(optional) TRUE if entities should be published if in this state, FALSE if not. Defaults to FALSE.

bool $default_revision

(optional) TRUE if entities should be the default revision if in this state, FALSE if not. Defaults to FALSE.

bool isPublishedState()

Determines if entities should be published if in this state.

Return Value

bool

bool isDefaultRevisionState()

Determines if entities should be the default revision if in this state.

Return Value

bool

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.