1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the slince/shopify-api-php |
5
|
|
|
* |
6
|
|
|
* (c) Slince <[email protected]> |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the MIT license that is bundled |
9
|
|
|
* with this source code in the file LICENSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Slince\Shopify\Manager\InventoryItem; |
13
|
|
|
|
14
|
|
|
use Slince\Shopify\Common\Model\Model; |
15
|
|
|
use Slince\Shopify\Common\Model\AdminGraphqlApiId; |
16
|
|
|
|
17
|
|
|
class InventoryItem extends Model |
18
|
|
|
{ |
19
|
|
|
use AdminGraphqlApiId; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var string |
23
|
|
|
*/ |
24
|
|
|
protected $sku; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var float |
28
|
|
|
*/ |
29
|
|
|
protected $cost; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var boolean |
33
|
|
|
*/ |
34
|
|
|
protected $tracked; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var \DateTimeInterface |
38
|
|
|
*/ |
39
|
|
|
protected $createdAt; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var \DateTimeInterface |
43
|
|
|
*/ |
44
|
|
|
protected $updatedAt; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return string |
48
|
|
|
*/ |
49
|
|
|
public function getSku() |
50
|
|
|
{ |
51
|
|
|
return $this->sku; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @param string $sku |
56
|
|
|
* |
57
|
|
|
* @return InventoryItem |
58
|
|
|
*/ |
59
|
|
|
public function setSku($sku) |
60
|
|
|
{ |
61
|
|
|
$this->sku = $sku; |
62
|
|
|
|
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return float |
68
|
|
|
*/ |
69
|
|
|
public function getCost() |
70
|
|
|
{ |
71
|
|
|
return $this->cost; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @param float $cost |
76
|
|
|
* |
77
|
|
|
* @return InventoryItem |
78
|
|
|
*/ |
79
|
|
|
public function setCost($cost) |
80
|
|
|
{ |
81
|
|
|
$this->cost = $cost; |
82
|
|
|
|
83
|
|
|
return $this; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return bool |
88
|
|
|
*/ |
89
|
|
|
public function isTracked() |
90
|
|
|
{ |
91
|
|
|
return $this->tracked; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @param bool $tracked |
96
|
|
|
* |
97
|
|
|
* @return InventoryItem |
98
|
|
|
*/ |
99
|
|
|
public function setTracked($tracked) |
100
|
|
|
{ |
101
|
|
|
$this->tracked = $tracked; |
102
|
|
|
|
103
|
|
|
return $this; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @return string |
108
|
|
|
*/ |
109
|
|
|
public function getAdminGraphqlApiId() |
110
|
|
|
{ |
111
|
|
|
return $this->adminGraphqlApiId; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @param string $adminGraphqlApiId |
116
|
|
|
* |
117
|
|
|
* @return InventoryItem |
118
|
|
|
*/ |
119
|
|
|
public function setAdminGraphqlApiId($adminGraphqlApiId) |
120
|
|
|
{ |
121
|
|
|
$this->adminGraphqlApiId = $adminGraphqlApiId; |
122
|
|
|
|
123
|
|
|
return $this; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return \DateTimeInterface |
128
|
|
|
*/ |
129
|
|
|
public function getCreatedAt() |
130
|
|
|
{ |
131
|
|
|
return $this->createdAt; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @param \DateTimeInterface $createdAt |
136
|
|
|
* |
137
|
|
|
* @return InventoryItem |
138
|
|
|
*/ |
139
|
|
|
public function setCreatedAt($createdAt) |
140
|
|
|
{ |
141
|
|
|
$this->createdAt = $createdAt; |
142
|
|
|
|
143
|
|
|
return $this; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @return \DateTimeInterface |
148
|
|
|
*/ |
149
|
|
|
public function getUpdatedAt() |
150
|
|
|
{ |
151
|
|
|
return $this->updatedAt; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @param \DateTimeInterface $updatedAt |
156
|
|
|
* |
157
|
|
|
* @return InventoryItem |
158
|
|
|
*/ |
159
|
|
|
public function setUpdatedAt($updatedAt) |
160
|
|
|
{ |
161
|
|
|
$this->updatedAt = $updatedAt; |
162
|
|
|
|
163
|
|
|
return $this; |
164
|
|
|
} |
165
|
|
|
} |