You are here

public function StateItemInterface::isValid in State Machine 8

Gets whether the current state is valid.

Drupal separates field validation into a separate step, allowing an invalid state to be set before validation is invoked. At that point validation has no access to the previous value, so it can't determine if the transition is allowed. Thus, the field item must track the state changes internally, and answer via this method if the current state is valid.

Return value

bool TRUE if the current state is valid, FALSE otherwise.

See also

\Drupal\state_machine\Plugin\Validation\Constraint\StateConstraintValidator

1 method overrides StateItemInterface::isValid()
StateItem::isValid in src/Plugin/Field/FieldType/StateItem.php
Gets whether the current state is valid.

File

src/Plugin/Field/FieldType/StateItemInterface.php, line 114

Class

StateItemInterface
Defines the interface for state field items.

Namespace

Drupal\state_machine\Plugin\Field\FieldType

Code

public function isValid();