commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ItemShippingTargetModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
15 use stdClass;
16 
21 {
26  protected $addressKey;
27 
32  protected $quantity;
33 
34 
38  public function __construct(
39  ?string $addressKey = null,
40  ?int $quantity = null
41  ) {
42  $this->addressKey = $addressKey;
43  $this->quantity = $quantity;
44  }
45 
52  public function getAddressKey()
53  {
54  if (is_null($this->addressKey)) {
56  $data = $this->raw(self::FIELD_ADDRESS_KEY);
57  if (is_null($data)) {
58  return null;
59  }
60  $this->addressKey = (string) $data;
61  }
62 
63  return $this->addressKey;
64  }
65 
72  public function getQuantity()
73  {
74  if (is_null($this->quantity)) {
76  $data = $this->raw(self::FIELD_QUANTITY);
77  if (is_null($data)) {
78  return null;
79  }
80  $this->quantity = (int) $data;
81  }
82 
83  return $this->quantity;
84  }
85 
86 
90  public function setAddressKey(?string $addressKey): void
91  {
92  $this->addressKey = $addressKey;
93  }
94 
98  public function setQuantity(?int $quantity): void
99  {
100  $this->quantity = $quantity;
101  }
102 }
__construct(?string $addressKey=null, ?int $quantity=null)