commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
QuoteStateTransitionMessagePayloadBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
18 use stdClass;
19 
24 {
29  private $state;
30 
35  private $oldState;
36 
41  private $force;
42 
49  public function getState()
50  {
51  return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state;
52  }
53 
60  public function getOldState()
61  {
62  return $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState;
63  }
64 
71  public function getForce()
72  {
73  return $this->force;
74  }
75 
80  public function withState(?StateReference $state)
81  {
82  $this->state = $state;
83 
84  return $this;
85  }
86 
91  public function withOldState(?StateReference $oldState)
92  {
93  $this->oldState = $oldState;
94 
95  return $this;
96  }
97 
102  public function withForce(?bool $force)
103  {
104  $this->force = $force;
105 
106  return $this;
107  }
108 
113  public function withStateBuilder(?StateReferenceBuilder $state)
114  {
115  $this->state = $state;
116 
117  return $this;
118  }
119 
124  public function withOldStateBuilder(?StateReferenceBuilder $oldState)
125  {
126  $this->oldState = $oldState;
127 
128  return $this;
129  }
130 
132  {
134  $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state,
135  $this->oldState instanceof StateReferenceBuilder ? $this->oldState->build() : $this->oldState,
136  $this->force
137  );
138  }
139 
141  {
142  return new self();
143  }
144 }