1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of michaelbutler/phposh. |
||
5 | * Source: https://github.com/michaelbutler/phposh |
||
6 | * |
||
7 | * (c) Michael Butler <[email protected]> |
||
8 | * |
||
9 | * This source file is subject to the MIT license that is bundled |
||
10 | * with this source code in the file named LICENSE. |
||
11 | */ |
||
12 | |||
13 | namespace PHPosh\Provider\Poshmark; |
||
14 | |||
15 | use PHPosh\Shared\BaseItem; |
||
16 | |||
17 | /** |
||
18 | * Data object representing an item on Poshmark. |
||
19 | * If you need the raw unmodified data from Poshmark, call getRawData(). |
||
20 | */ |
||
21 | class Item implements BaseItem |
||
22 | { |
||
23 | /** @var string Represents new with tags condition */ |
||
24 | public const CONDITION_NEW_WITH_TAGS = 'nwt'; |
||
25 | |||
26 | /** @var string Represents not new with tags condition */ |
||
27 | public const CONDITION_NOT_NEW_WITH_TAGS = 'not_nwt'; |
||
28 | |||
29 | /** @var string Unique identifier of the item on Poshmark */ |
||
30 | private $id; |
||
31 | |||
32 | /** @var string Title */ |
||
33 | private $title; |
||
34 | |||
35 | /** @var string Description */ |
||
36 | private $description; |
||
37 | |||
38 | /** @var string Condition string. either "not_nwt" or "nwt" */ |
||
39 | private $condition; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
40 | |||
41 | /** @var string Main Category ID */ |
||
42 | private $category; |
||
0 ignored issues
–
show
|
|||
43 | |||
44 | /** @var string Main Department ID */ |
||
45 | private $department; |
||
0 ignored issues
–
show
|
|||
46 | |||
47 | /** @var string[] List of category feature IDs */ |
||
48 | private $category_features = []; |
||
0 ignored issues
–
show
|
|||
49 | |||
50 | /** @var string[] List of colors */ |
||
51 | private $colors = []; |
||
0 ignored issues
–
show
|
|||
52 | |||
53 | /** @var string Brand name */ |
||
54 | private $brand; |
||
55 | |||
56 | /** @var Price Current price (object) */ |
||
57 | private $price; |
||
58 | |||
59 | /** @var Price Original price, if any (object) */ |
||
60 | private $origPrice; |
||
61 | |||
62 | /** @var string Full URL to image of item (cover_shot) */ |
||
63 | private $imageUrl; |
||
64 | |||
65 | /** @var string ID of cover shot photo */ |
||
66 | private $coverShotId; |
||
0 ignored issues
–
show
|
|||
67 | |||
68 | /** @var array Array of additional (not cover) photos */ |
||
69 | private $pictures; |
||
0 ignored issues
–
show
|
|||
70 | |||
71 | /** @var array Optional private seller info (such as sku) */ |
||
72 | private $sellerPrivateInfo; |
||
0 ignored issues
–
show
|
|||
73 | |||
74 | /** @var \DateTime When this item was originally created/listed */ |
||
75 | private $createdAt; |
||
76 | |||
77 | /** @var string Size of item, e.g. "X-Large", "34 x 32", or "3" */ |
||
78 | private $size; |
||
79 | |||
80 | /** @var string URL to item page on the provider site */ |
||
81 | private $externalUrl; |
||
82 | |||
83 | /** @var array Original raw data from provider */ |
||
84 | private $rawData = []; |
||
85 | |||
86 | 1 | public function getTitle(): string |
|
87 | { |
||
88 | 1 | return $this->title; |
|
89 | } |
||
90 | |||
91 | 1 | public function setTitle(string $title): Item |
|
92 | { |
||
93 | 1 | $this->title = $title; |
|
94 | |||
95 | 1 | return $this; |
|
96 | } |
||
97 | |||
98 | 1 | public function getDescription(): string |
|
99 | { |
||
100 | 1 | return $this->description; |
|
101 | } |
||
102 | |||
103 | 1 | public function setDescription(string $description): Item |
|
104 | { |
||
105 | 1 | $this->description = $description; |
|
106 | |||
107 | 1 | return $this; |
|
108 | } |
||
109 | |||
110 | 1 | public function getBrand(): string |
|
111 | { |
||
112 | 1 | return $this->brand; |
|
113 | } |
||
114 | |||
115 | 1 | public function setBrand(string $brand): Item |
|
116 | { |
||
117 | 1 | $this->brand = $brand; |
|
118 | |||
119 | 1 | return $this; |
|
120 | } |
||
121 | |||
122 | 1 | public function getPrice(): Price |
|
123 | { |
||
124 | 1 | return $this->price; |
|
125 | } |
||
126 | |||
127 | 1 | public function setPrice(Price $price): Item |
|
128 | { |
||
129 | 1 | $this->price = $price; |
|
130 | |||
131 | 1 | return $this; |
|
132 | } |
||
133 | |||
134 | 1 | public function getOrigPrice(): Price |
|
135 | { |
||
136 | 1 | return $this->origPrice; |
|
137 | } |
||
138 | |||
139 | 1 | public function setOrigPrice(Price $origPrice): Item |
|
140 | { |
||
141 | 1 | $this->origPrice = $origPrice; |
|
142 | |||
143 | 1 | return $this; |
|
144 | } |
||
145 | |||
146 | 1 | public function getImageUrl(): string |
|
147 | { |
||
148 | 1 | return $this->imageUrl; |
|
149 | } |
||
150 | |||
151 | 1 | public function setImageUrl(string $imageUrl): Item |
|
152 | { |
||
153 | 1 | $this->imageUrl = $imageUrl; |
|
154 | |||
155 | 1 | return $this; |
|
156 | } |
||
157 | |||
158 | 1 | public function getCreatedAt(): \DateTime |
|
159 | { |
||
160 | 1 | return $this->createdAt; |
|
161 | } |
||
162 | |||
163 | 1 | public function setCreatedAt(\DateTime $createdAt): Item |
|
164 | { |
||
165 | 1 | $this->createdAt = $createdAt; |
|
166 | |||
167 | 1 | return $this; |
|
168 | } |
||
169 | |||
170 | 1 | public function getSize(): string |
|
171 | { |
||
172 | 1 | return $this->size; |
|
173 | } |
||
174 | |||
175 | 1 | public function setSize(string $size): Item |
|
176 | { |
||
177 | 1 | $this->size = $size; |
|
178 | |||
179 | 1 | return $this; |
|
180 | } |
||
181 | |||
182 | 1 | public function getExternalUrl(): string |
|
183 | { |
||
184 | 1 | return $this->externalUrl; |
|
185 | } |
||
186 | |||
187 | 1 | public function setExternalUrl(string $externalUrl): Item |
|
188 | { |
||
189 | 1 | $this->externalUrl = $externalUrl; |
|
190 | |||
191 | 1 | return $this; |
|
192 | } |
||
193 | |||
194 | 1 | public function getId(): string |
|
195 | { |
||
196 | 1 | return $this->id; |
|
197 | } |
||
198 | |||
199 | 1 | public function setId(string $id): Item |
|
200 | { |
||
201 | 1 | $this->id = $id; |
|
202 | |||
203 | 1 | return $this; |
|
204 | } |
||
205 | |||
206 | 1 | public function getRawData(): array |
|
207 | { |
||
208 | 1 | return $this->rawData; |
|
209 | } |
||
210 | |||
211 | 1 | public function setRawData(array $rawData): Item |
|
212 | { |
||
213 | 1 | $this->rawData = $rawData; |
|
214 | |||
215 | 1 | return $this; |
|
216 | } |
||
217 | } |
||
218 |