3 namespace Drupal\workflows;
6 * An interface for state value objects.
8 * @see \Drupal\workflows\WorkflowTypeInterface::decorateState()
11 * The workflow system is currently experimental and should only be leveraged
12 * by experimental modules and development releases of contributed modules.
14 interface StateInterface {
17 * Gets the state's ID.
25 * Gets the state's label.
30 public function label();
33 * Gets the state's weight.
38 public function weight();
41 * Determines if the state can transition to the provided state ID.
44 * The state to transition to.
47 * TRUE if the state can transition to the provided state ID. FALSE, if not.
49 public function canTransitionTo($to_state_id);
52 * Gets the Transition object for the provided state ID.
55 * The state to transition to.
57 * @return \Drupal\workflows\TransitionInterface
58 * The Transition object for the provided state ID.
60 * @throws \InvalidArgumentException()
61 * Exception thrown when the provided state ID can not be transitioned to.
63 public function getTransitionTo($to_state_id);
66 * Gets all the possible transition objects for the state.
68 * @return \Drupal\workflows\TransitionInterface[]
69 * All the possible transition objects for the state.
71 public function getTransitions();