3 namespace Drupal\workflow_type_test;
5 use Drupal\workflows\StateInterface;
8 * A value object representing a workflow state.
10 class DecoratedState implements StateInterface {
13 * The vanilla state object from the Workflow module.
15 * @var \Drupal\workflows\StateInterface
20 * Extra information added to state.
27 * DecoratedState constructor.
29 * @param \Drupal\workflows\StateInterface $state
30 * The vanilla state object from the Workflow module.
31 * @param string $extra
32 * (optional) Extra information stored on the state. Defaults to ''.
34 public function __construct(StateInterface $state, $extra = '') {
35 $this->state = $state;
36 $this->extra = $extra;
40 * Gets the extra information stored on the state.
44 public function getExtra() {
51 public function id() {
52 return $this->state->id();
58 public function label() {
59 return $this->state->label();
65 public function weight() {
66 return $this->state->weight();
72 public function canTransitionTo($to_state_id) {
73 return $this->state->canTransitionTo($to_state_id);
79 public function getTransitionTo($to_state_id) {
80 return $this->state->getTransitionTo($to_state_id);
86 public function getTransitions() {
87 return $this->state->getTransitions();