commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ChangeLineItemQuantityChangeBuilder.php
1 <?php
2 
3 declare(strict_types=1);
10 
16 use stdClass;
19 
24 {
29  private $change;
30 
35  private $previousValue;
36 
41  private $nextValue;
42 
47  private $lineItem;
48 
53  private $lineItemId;
54 
59  public function getChange()
60  {
61  return $this->change;
62  }
63 
70  public function getPreviousValue()
71  {
72  return $this->previousValue;
73  }
74 
81  public function getNextValue()
82  {
83  return $this->nextValue;
84  }
85 
92  public function getLineItem()
93  {
94  return $this->lineItem instanceof LocalizedStringBuilder ? $this->lineItem->build() : $this->lineItem;
95  }
96 
103  public function getLineItemId()
104  {
105  return $this->lineItemId;
106  }
107 
112  public function withChange(?string $change)
113  {
114  $this->change = $change;
115 
116  return $this;
117  }
118 
123  public function withPreviousValue(?int $previousValue)
124  {
125  $this->previousValue = $previousValue;
126 
127  return $this;
128  }
129 
134  public function withNextValue(?int $nextValue)
135  {
136  $this->nextValue = $nextValue;
137 
138  return $this;
139  }
140 
145  public function withLineItem(?LocalizedString $lineItem)
146  {
147  $this->lineItem = $lineItem;
148 
149  return $this;
150  }
151 
156  public function withLineItemId(?string $lineItemId)
157  {
158  $this->lineItemId = $lineItemId;
159 
160  return $this;
161  }
162 
167  public function withLineItemBuilder(?LocalizedStringBuilder $lineItem)
168  {
169  $this->lineItem = $lineItem;
170 
171  return $this;
172  }
173 
175  {
177  $this->change,
178  $this->previousValue,
179  $this->nextValue,
180  $this->lineItem instanceof LocalizedStringBuilder ? $this->lineItem->build() : $this->lineItem,
181  $this->lineItemId
182  );
183  }
184 
185  public static function of(): ChangeLineItemQuantityChangeBuilder
186  {
187  return new self();
188  }
189 }