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