1 | <?php |
||
17 | class Details |
||
18 | { |
||
19 | private const ENTITY_ID = 'id'; |
||
20 | |||
21 | private const ENTITY_TYPE_ID = 'entity_type_id'; |
||
22 | |||
23 | private const SKU = 'sku'; |
||
24 | |||
25 | private const NAME = 'name'; |
||
26 | |||
27 | private const ATTRIBUTE_SET_ID = 'attribute_set_id'; |
||
28 | |||
29 | private const STATUS = 'status'; |
||
30 | |||
31 | private const VISIBILITY = 'visibility'; |
||
32 | |||
33 | private const TYPE = 'type_id'; |
||
34 | |||
35 | private const CREATED_AT = 'created_at'; |
||
36 | |||
37 | private const UPDATED_AT = 'updated_at'; |
||
38 | |||
39 | private const EXTENSION_ATTRIBUTES = 'extension_attributes'; |
||
40 | |||
41 | private const PRODUCT_LINKS = 'product_links'; |
||
42 | |||
43 | private const TIER_PRICES = 'tier_prices'; |
||
44 | |||
45 | private const CUSTOM_ATTRIBUTES = 'custom_attributes'; |
||
46 | |||
47 | private const DESCRIPTION = 'description'; |
||
48 | |||
49 | private const IMAGE = 'image'; |
||
50 | |||
51 | private const SMALL_IMAGE = 'small_image'; |
||
52 | |||
53 | private const THUMBNAIL = 'thumbnail'; |
||
54 | |||
55 | private const REQUIRED_OPTIONS = 'required_options'; |
||
56 | |||
57 | private const HAS_OPTIONS = 'has_options'; |
||
58 | |||
59 | private const URL_KEY = 'url_key'; |
||
60 | |||
61 | private const TAX_CLASS_ID = 'tax_class_id'; |
||
62 | |||
63 | private const ERIN_RECOMMENDS = 'erin_recommends'; |
||
64 | |||
65 | private const NEW = 'new'; |
||
66 | |||
67 | private const SALE = 'sale'; |
||
68 | |||
69 | private const CHILDREN_DATA = 'children_data'; |
||
70 | |||
71 | // TODO DEMO APP ONLY |
||
72 | private const SLUG = 'slug'; |
||
73 | |||
74 | private const PARENT_SKU = 'parentSku'; |
||
75 | |||
76 | private const IS_CONFIGURED = 'is_configured'; |
||
77 | |||
78 | // TODO PROPERTIES BELOW APPEAR ONLY IN CORESHOP VS BRIDGE |
||
79 | |||
80 | private const AVAILABILITY = 'availability'; |
||
81 | |||
82 | private const TEXT_STATUS = 'option_text_status'; |
||
83 | |||
84 | private const TAX_CLASS_NAME = 'option_text_tax_class_id'; |
||
85 | |||
86 | private const SHORT_DESCRIPTION = 'short_description'; |
||
87 | |||
88 | private const COLOR_OPTIONS = 'color_options'; |
||
89 | |||
90 | private const SIZE_OPTIONS = 'size_options'; |
||
91 | |||
92 | // INTEGRATION BOILERPLATE |
||
93 | private const META_TITLE = 'meta_title'; |
||
94 | |||
95 | private const META_DESCRIPTION = 'meta_description'; |
||
96 | |||
97 | private const GIFT_MESSAGE_AVAILABLE = 'gift_message_available'; |
||
98 | |||
99 | private const SPECIAL_FROM_DATE = 'special_from_date'; |
||
100 | |||
101 | private const SPECIAL_TO_DATE = 'special_to_date'; |
||
102 | |||
103 | private const TYPE_SIMPLE = 'simple'; |
||
104 | |||
105 | private const TYPE_CONFIGURABLE = 'configurable'; |
||
106 | |||
107 | /** https://docs.magento.com/m2/ce/user_guide/system/data-attributes-product.html */ |
||
108 | private const TYPES_IN_MAGENTO2 = [self::TYPE_SIMPLE, self::TYPE_CONFIGURABLE, 'grouped', 'virtual', 'bundle']; |
||
109 | |||
110 | private const DEFAULT_ENTITY_TYPE_ID = 4; |
||
111 | |||
112 | private const DEFAULT_ATTRIBUTE_SET_ID = 11; |
||
113 | |||
114 | private const DEFAULT_STATUS = 1; |
||
115 | |||
116 | private const DEFAULT_VISIBILITY = 4; |
||
117 | |||
118 | private const DEFAULT_TYPE = self::TYPE_SIMPLE; |
||
119 | |||
120 | private const DEFAULT_CATEGORY_ID = 2; |
||
121 | |||
122 | private const DEFAULT_AVAILABILITY = '1'; |
||
123 | |||
124 | private const DEFAULT_OPTION_STATUS = 'Enabled'; |
||
125 | |||
126 | private const DEFAULT_TAX_CLASS_ID = 2; |
||
127 | |||
128 | private const DEFAULT_TAX_CLASS_NAME = 'Taxable Goods'; |
||
129 | |||
130 | private const DEFAULT_CATEGORY = 'Default category'; |
||
131 | |||
132 | private const DEFAULT_MEDIA_TYPE = 'image'; |
||
133 | |||
134 | // NODEAPP MAPPING COMPARISON |
||
135 | private const URL_PATH = 'url_path'; |
||
136 | |||
137 | /** @var string */ |
||
138 | private $urlPath; |
||
139 | |||
140 | // END OF NODEAPP COMPARISON |
||
141 | |||
142 | /** @var int */ |
||
143 | private $entityId; |
||
144 | |||
145 | /** @var int */ |
||
146 | private $entityTypeId; |
||
147 | |||
148 | /** @var int */ |
||
149 | private $attributeSetId; |
||
150 | |||
151 | /** @var string */ |
||
152 | private $type; |
||
153 | |||
154 | /** @var string */ |
||
155 | private $sku; |
||
156 | |||
157 | /** @var string */ |
||
158 | private $urlKey; |
||
159 | |||
160 | /** @var string */ |
||
161 | private $name; |
||
162 | |||
163 | /** @var int */ |
||
164 | private $status; |
||
165 | |||
166 | /** @var int */ |
||
167 | private $visibility; |
||
168 | |||
169 | /** @var \DateTimeInterface */ |
||
170 | private $createdAt; |
||
171 | |||
172 | /** @var \DateTimeInterface */ |
||
173 | private $updatedAt; |
||
174 | |||
175 | /** @var string */ |
||
176 | private $image; |
||
177 | |||
178 | /** @var bool */ |
||
179 | private $availability; |
||
180 | |||
181 | /** @var string */ |
||
182 | private $textStatus; |
||
183 | |||
184 | /** @var int */ |
||
185 | private $taxClassId; |
||
186 | |||
187 | /** @var string */ |
||
188 | private $taxClassName; |
||
189 | |||
190 | /** @var string */ |
||
191 | private $description; |
||
192 | |||
193 | /** @var string */ |
||
194 | private $shortDescription; |
||
195 | |||
196 | /** @var int */ |
||
197 | private $hasOptions; |
||
198 | |||
199 | /** @var int */ |
||
200 | private $requiredOptions; |
||
201 | |||
202 | /** @var array */ |
||
203 | private $productLinks; |
||
204 | |||
205 | /** @var array */ |
||
206 | private $colorOptions; |
||
207 | |||
208 | /** @var array */ |
||
209 | private $sizeOptions; |
||
210 | |||
211 | // TODO OPTIONAL STUFF FROM VARIOUS PLACES |
||
212 | |||
213 | /** @var array */ |
||
214 | private $extensionAttributes = []; |
||
215 | |||
216 | /** @var array */ |
||
217 | private $tierPrices = []; |
||
218 | |||
219 | /** @var array|null */ |
||
220 | private $customAttributes; |
||
221 | |||
222 | /** @var string */ |
||
223 | private $smallImage = '/a/b/small.jpg'; |
||
224 | |||
225 | /** @var string */ |
||
226 | private $thumbnail = '/a/b/small.jpg'; |
||
227 | |||
228 | /** @var bool */ |
||
229 | private $erinRecommends = true; |
||
230 | |||
231 | /** @var bool */ |
||
232 | private $new = true; |
||
233 | |||
234 | /** @var bool */ |
||
235 | private $sale = true; |
||
236 | |||
237 | /** @var array */ |
||
238 | private $childrenData = []; |
||
239 | |||
240 | /** @var string */ |
||
241 | private $slug; |
||
242 | |||
243 | /** @var string */ |
||
244 | private $parentSku; |
||
245 | |||
246 | /** @var bool */ |
||
247 | private $isConfigured = true; |
||
248 | |||
249 | // TODO INTEGRATION BOILERPLATE ONLY |
||
250 | |||
251 | /** @var string|null */ |
||
252 | private $metaTitle; |
||
253 | |||
254 | /** @var string|null */ |
||
255 | private $metaDescription; |
||
256 | |||
257 | /** @var bool|null */ |
||
258 | private $giftMessageAvailable; |
||
259 | |||
260 | /** @var \DateTime|null */ |
||
261 | private $specialFromDate; |
||
262 | |||
263 | /** @var \DateTime|null */ |
||
264 | private $specialToDate; |
||
265 | |||
266 | public function __construct( |
||
319 | |||
320 | public function toArray(): array |
||
366 | |||
367 | public function isConfigurableProduct(): bool |
||
371 | } |
||
372 |