commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ReturnItemDraftModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
26  protected $quantity;
27 
32  protected $lineItemId;
33 
38  protected $customLineItemId;
39 
44  protected $comment;
45 
50  protected $shipmentState;
51 
52 
56  public function __construct(
57  ?int $quantity = null,
58  ?string $lineItemId = null,
59  ?string $customLineItemId = null,
60  ?string $comment = null,
61  ?string $shipmentState = null
62  ) {
63  $this->quantity = $quantity;
64  $this->lineItemId = $lineItemId;
65  $this->customLineItemId = $customLineItemId;
66  $this->comment = $comment;
67  $this->shipmentState = $shipmentState;
68  }
69 
74  public function getQuantity()
75  {
76  if (is_null($this->quantity)) {
78  $data = $this->raw(self::FIELD_QUANTITY);
79  if (is_null($data)) {
80  return null;
81  }
82  $this->quantity = (int) $data;
83  }
84 
85  return $this->quantity;
86  }
87 
92  public function getLineItemId()
93  {
94  if (is_null($this->lineItemId)) {
96  $data = $this->raw(self::FIELD_LINE_ITEM_ID);
97  if (is_null($data)) {
98  return null;
99  }
100  $this->lineItemId = (string) $data;
101  }
102 
103  return $this->lineItemId;
104  }
105 
110  public function getCustomLineItemId()
111  {
112  if (is_null($this->customLineItemId)) {
114  $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_ID);
115  if (is_null($data)) {
116  return null;
117  }
118  $this->customLineItemId = (string) $data;
119  }
120 
122  }
123 
128  public function getComment()
129  {
130  if (is_null($this->comment)) {
132  $data = $this->raw(self::FIELD_COMMENT);
133  if (is_null($data)) {
134  return null;
135  }
136  $this->comment = (string) $data;
137  }
138 
139  return $this->comment;
140  }
141 
148  public function getShipmentState()
149  {
150  if (is_null($this->shipmentState)) {
152  $data = $this->raw(self::FIELD_SHIPMENT_STATE);
153  if (is_null($data)) {
154  return null;
155  }
156  $this->shipmentState = (string) $data;
157  }
158 
159  return $this->shipmentState;
160  }
161 
162 
166  public function setQuantity(?int $quantity): void
167  {
168  $this->quantity = $quantity;
169  }
170 
174  public function setLineItemId(?string $lineItemId): void
175  {
176  $this->lineItemId = $lineItemId;
177  }
178 
182  public function setCustomLineItemId(?string $customLineItemId): void
183  {
184  $this->customLineItemId = $customLineItemId;
185  }
186 
190  public function setComment(?string $comment): void
191  {
192  $this->comment = $comment;
193  }
194 
198  public function setShipmentState(?string $shipmentState): void
199  {
200  $this->shipmentState = $shipmentState;
201  }
202 }
__construct(?int $quantity=null, ?string $lineItemId=null, ?string $customLineItemId=null, ?string $comment=null, ?string $shipmentState=null)