You are here

class StateConstraint in State Machine 8

Ensures the validity of the specified state.

The state must exist on the used workflow, and be in the allowed transitions.

Plugin annotation


@Constraint(
  id = "State",
  label = @Translation("State", context = "Validation")
)

Hierarchy

  • class \Drupal\state_machine\Plugin\Validation\Constraint\StateConstraint extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of StateConstraint

File

src/Plugin/Validation/Constraint/StateConstraint.php, line 17

Namespace

Drupal\state_machine\Plugin\Validation\Constraint
View source
class StateConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = "The state '@state' is invalid.";

}

Members

Namesort descending Modifiers Type Description Overrides
StateConstraint::$message public property The default violation message.