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