|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Helix\Shopify; |
|
4
|
|
|
|
|
5
|
|
|
use Helix\Shopify\Base\AbstractEntity; |
|
6
|
|
|
use Helix\Shopify\Base\AbstractEntity\CreateTrait; |
|
7
|
|
|
use Helix\Shopify\Base\AbstractEntity\UpdateTrait; |
|
8
|
|
|
use Helix\Shopify\InventoryItem\CHSCode; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* An inventory item. |
|
12
|
|
|
* |
|
13
|
|
|
* Inventory items cannot be deleted. |
|
14
|
|
|
* |
|
15
|
|
|
* @see https://shopify.dev/docs/admin-api/rest/reference/inventory/inventoryitem |
|
16
|
|
|
* |
|
17
|
|
|
* @method number getCost () |
|
18
|
|
|
* @method string getCountryCodeOfOrigin () |
|
19
|
|
|
* @method string getCreatedAt () |
|
20
|
|
|
* @method string getHarmonizedSystemCode () |
|
21
|
|
|
* @method CHSCode[] getCountryHarmonizedSystemCodes () |
|
22
|
|
|
* @method string getProvinceCodeOfOrigin () @depends canada-only |
|
23
|
|
|
* @method bool isRequiresShipping () |
|
24
|
|
|
* @method string getSku () |
|
25
|
|
|
* @method bool isTracked () |
|
26
|
|
|
* @method string getUpdatedAt () |
|
27
|
|
|
* |
|
28
|
|
|
* @method $this setCountryCodeOfOrigin (string $code) |
|
29
|
|
|
* @method $this setCountryHarmonizedSystemCodes (CHSCode[] $codes) |
|
30
|
|
|
* @method $this setCost (number $cost) |
|
31
|
|
|
* @method $this setHarmonizedSystemCode (string $code) |
|
32
|
|
|
* @method $this setProvinceCodeOfOrigin (string $code) @depends canada-only |
|
33
|
|
|
* @method $this setSku (string $sku) |
|
34
|
|
|
* @method $this setTracked (string $tracked) |
|
35
|
|
|
*/ |
|
36
|
|
|
class InventoryItem extends AbstractEntity |
|
37
|
|
|
{ |
|
38
|
|
|
|
|
39
|
|
|
use CreateTrait; |
|
40
|
|
|
use UpdateTrait; |
|
41
|
|
|
|
|
42
|
|
|
const TYPE = 'inventory_item'; |
|
43
|
|
|
const DIR = 'inventory_items'; |
|
44
|
|
|
|
|
45
|
|
|
const MAP = [ |
|
46
|
|
|
'country_harmonized_system_codes' => [CHSCode::class] |
|
47
|
|
|
]; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Factory. |
|
51
|
|
|
* |
|
52
|
|
|
* @return CHSCode |
|
53
|
|
|
*/ |
|
54
|
|
|
public function newCHSCode() |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->api->factory($this, CHSCode::class); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
} |