| Total Complexity | 3 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | class InventoryCreateRequestEntity extends RequestEntity |
||
| 30 | { |
||
| 31 | const UNDERSCORE_ON_SERIALIZATION = false; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Subscription external id. |
||
| 35 | * Required for all requests. |
||
| 36 | * |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | protected $externalId; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Target product SKU |
||
| 43 | * |
||
| 44 | * @var string |
||
| 45 | */ |
||
| 46 | protected $sku; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Initial qty of a product. |
||
| 50 | * Only first request will actually create an inventory record on payever side. |
||
| 51 | * All further create requests will be ignored. |
||
| 52 | * |
||
| 53 | * @var int |
||
| 54 | */ |
||
| 55 | protected $stock; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @param string $sku |
||
| 59 | * @return static |
||
| 60 | */ |
||
| 61 | public function setSku($sku) |
||
| 62 | { |
||
| 63 | $this->sku = (string) $sku; |
||
| 64 | |||
| 65 | return $this; |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param int|float|string $stock |
||
| 70 | * @return static |
||
| 71 | */ |
||
| 72 | public function setStock($stock) |
||
| 73 | { |
||
| 74 | $this->stock = (int) $stock; |
||
| 75 | |||
| 76 | return $this; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return array |
||
| 81 | */ |
||
| 82 | public function getRequired() |
||
| 88 | ); |
||
| 89 | } |
||
| 90 | } |
||
| 91 |