1 | <?php |
||
37 | class ProductAttributeObserver extends AbstractProductImportObserver |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The ID of the attribute to create the values for. |
||
42 | * |
||
43 | * @var integer |
||
44 | */ |
||
45 | protected $attributeId; |
||
46 | |||
47 | /** |
||
48 | * The attribute code of the attribute to create the values for. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $attributeCode; |
||
53 | |||
54 | /** |
||
55 | * The backend type of the attribute to create the values for. |
||
56 | * |
||
57 | * @var string |
||
58 | */ |
||
59 | protected $backendType; |
||
60 | |||
61 | /** |
||
62 | * The attribute value to process. |
||
63 | * |
||
64 | * @var mixed |
||
65 | */ |
||
66 | protected $attributeValue; |
||
67 | |||
68 | /** |
||
69 | * Process the observer's business logic. |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | protected function process() |
||
155 | |||
156 | /** |
||
157 | * Prepare the attributes of the entity that has to be persisted. |
||
158 | * |
||
159 | * @return array The prepared attributes |
||
160 | */ |
||
161 | protected function prepareAttributes() |
||
191 | |||
192 | /** |
||
193 | * Initialize the category product with the passed attributes and returns an instance. |
||
194 | * |
||
195 | * @param array $attr The category product attributes |
||
196 | * |
||
197 | * @return array The initialized category product |
||
198 | */ |
||
199 | protected function initializeAttribute(array $attr) |
||
203 | |||
204 | /** |
||
205 | * Return's the PK to create the product => attribute relation. |
||
206 | * |
||
207 | * @return integer The PK to create the relation with |
||
208 | */ |
||
209 | protected function getPrimaryKey() |
||
213 | |||
214 | /** |
||
215 | * Map the passed attribute code, if a header mapping exists and return the |
||
216 | * mapped mapping. |
||
217 | * |
||
218 | * @param string $attributeCode The attribute code to map |
||
219 | * |
||
220 | * @return string The mapped attribute code, or the original one |
||
221 | */ |
||
222 | protected function mapAttributeCodeByHeaderMapping($attributeCode) |
||
226 | |||
227 | /** |
||
228 | * Return's the array with callbacks for the passed type. |
||
229 | * |
||
230 | * @param string $type The type of the callbacks to return |
||
231 | * |
||
232 | * @return array The callbacks |
||
233 | */ |
||
234 | protected function getCallbacksByType($type) |
||
238 | |||
239 | /** |
||
240 | * Return's mapping for the supported backend types (for the product entity) => persist methods. |
||
241 | * |
||
242 | * @return array The mapping for the supported backend types |
||
243 | */ |
||
244 | protected function getBackendTypes() |
||
248 | |||
249 | /** |
||
250 | * Return's the attributes for the attribute set of the product that has to be created. |
||
251 | * |
||
252 | * @return array The attributes |
||
253 | * @throws \Exception |
||
254 | */ |
||
255 | protected function getAttributes() |
||
259 | |||
260 | /** |
||
261 | * Return's the store ID of the actual row, or of the default store |
||
262 | * if no store view code is set in the CSV file. |
||
263 | * |
||
264 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
265 | * |
||
266 | * @return integer The ID of the actual store |
||
267 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
268 | */ |
||
269 | protected function getRowStoreId($default = null) |
||
273 | |||
274 | /** |
||
275 | * Persist's the passed product varchar attribute. |
||
276 | * |
||
277 | * @param array $attribute The attribute to persist |
||
278 | * |
||
279 | * @return void |
||
280 | */ |
||
281 | protected function persistProductVarcharAttribute($attribute) |
||
285 | |||
286 | /** |
||
287 | * Persist's the passed product integer attribute. |
||
288 | * |
||
289 | * @param array $attribute The attribute to persist |
||
290 | * |
||
291 | * @return void |
||
292 | */ |
||
293 | protected function persistProductIntAttribute($attribute) |
||
297 | |||
298 | /** |
||
299 | * Persist's the passed product decimal attribute. |
||
300 | * |
||
301 | * @param array $attribute The attribute to persist |
||
302 | * |
||
303 | * @return void |
||
304 | */ |
||
305 | protected function persistProductDecimalAttribute($attribute) |
||
309 | |||
310 | /** |
||
311 | * Persist's the passed product datetime attribute. |
||
312 | * |
||
313 | * @param array $attribute The attribute to persist |
||
314 | * |
||
315 | * @return void |
||
316 | */ |
||
317 | protected function persistProductDatetimeAttribute($attribute) |
||
321 | |||
322 | /** |
||
323 | * Persist's the passed product text attribute. |
||
324 | * |
||
325 | * @param array $attribute The attribute to persist |
||
326 | * |
||
327 | * @return void |
||
328 | */ |
||
329 | protected function persistProductTextAttribute($attribute) |
||
333 | } |
||
334 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.