Complex classes like AttributeBunchProcessor often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use AttributeBunchProcessor, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
47 | class AttributeBunchProcessor implements AttributeBunchProcessorInterface |
||
48 | { |
||
49 | |||
50 | /** |
||
51 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
52 | * |
||
53 | * @var \PDO |
||
54 | */ |
||
55 | protected $connection; |
||
56 | |||
57 | /** |
||
58 | * The attribute repository instance. |
||
59 | * |
||
60 | * @var \TechDivision\Import\Attribute\Repositories\AttributeRepository |
||
61 | */ |
||
62 | protected $attributeRepository; |
||
63 | |||
64 | /** |
||
65 | * The attribute label repository instance. |
||
66 | * |
||
67 | * @var \TechDivision\Import\Attribute\Repositories\AttributeLabelRepository |
||
68 | */ |
||
69 | protected $attributeLabelRepository; |
||
70 | |||
71 | /** |
||
72 | * The attribute option repository instance. |
||
73 | * |
||
74 | * @var \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository |
||
75 | */ |
||
76 | protected $attributeOptionRepository; |
||
77 | |||
78 | /** |
||
79 | * The repository to access EAV attribute option values. |
||
80 | * |
||
81 | * @var \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository |
||
82 | */ |
||
83 | protected $eavAttributeOptionValueRepository; |
||
84 | |||
85 | /** |
||
86 | * The attribute option swatch repository instance. |
||
87 | * |
||
88 | * @var \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository |
||
89 | */ |
||
90 | protected $attributeOptionSwatchRepository; |
||
91 | |||
92 | /** |
||
93 | * The catalog attribute repository instance. |
||
94 | * |
||
95 | * @var \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository |
||
96 | */ |
||
97 | protected $catalogAttributeRepository; |
||
98 | |||
99 | /** |
||
100 | * The entity attribute repository instance. |
||
101 | * |
||
102 | * @var \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository |
||
103 | */ |
||
104 | protected $entityAttributeRepository; |
||
105 | |||
106 | /** |
||
107 | * The attribute action instance. |
||
108 | * |
||
109 | * @var \TechDivision\Import\Attribute\Actions\AttributeAction |
||
110 | */ |
||
111 | protected $attributeAction; |
||
112 | |||
113 | /** |
||
114 | * The attribute label action instance. |
||
115 | * |
||
116 | * @var \TechDivision\Import\Attribute\Actions\AttributeLabelAction |
||
117 | */ |
||
118 | protected $attributeLabelAction; |
||
119 | |||
120 | /** |
||
121 | * The attribute option action instance. |
||
122 | * |
||
123 | * @var \TechDivision\Import\Attribute\Actions\AttributeOptionAction |
||
124 | */ |
||
125 | protected $attributeOptionAction; |
||
126 | |||
127 | /** |
||
128 | * The attribute option value action instance. |
||
129 | * |
||
130 | * @var \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction |
||
131 | */ |
||
132 | protected $attributeOptionValueAction; |
||
133 | |||
134 | /** |
||
135 | * The attribute option swatch action instance. |
||
136 | * |
||
137 | * @var \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction |
||
138 | */ |
||
139 | protected $attributeOptionSwatchAction; |
||
140 | |||
141 | /** |
||
142 | * The attribute action instance. |
||
143 | * |
||
144 | * @var \TechDivision\Import\Attribute\Actions\CatalogAttributeAction |
||
145 | */ |
||
146 | protected $catalogAttributeAction; |
||
147 | |||
148 | /** |
||
149 | * The entity attribute action instance. |
||
150 | * |
||
151 | * @var \TechDivision\Import\Attribute\Actions\EntityAttributeAction |
||
152 | */ |
||
153 | protected $entityAttributeAction; |
||
154 | |||
155 | /** |
||
156 | * Initialize the processor with the necessary assembler and repository instances. |
||
157 | * |
||
158 | * @param \PDO $connection The PDO connection to use |
||
159 | * @param \TechDivision\Import\Attribute\Repositories\AttributeRepository $attributeRepository The attribute repository instance |
||
160 | * @param \TechDivision\Import\Attribute\Repositories\AttributeLabelRepository $attributeLabelRepository The attribute label repository instance |
||
161 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository The attribute repository instance |
||
162 | * @param \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository The EAV attribute option value repository to use |
||
163 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository $attributeOptionSwatchRepository The attribute repository swatch instance |
||
164 | * @param \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository $catalogAttributeRepository The catalog attribute repository instance |
||
165 | * @param \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository $entityAttributeRepository The entity attribute repository instance |
||
166 | * @param \TechDivision\Import\Attribute\Actions\AttributeAction $attributeAction The attribute action instance |
||
167 | * @param \TechDivision\Import\Attribute\Actions\AttributeLabelAction $attributeLabelAction The attribute label action instance |
||
168 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionAction $attributeOptionAction The attribute option action instance |
||
169 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction $attributeOptionValueAction The attribute option value action instance |
||
170 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction $attributeOptionSwatchAction The attribute option swatch action instance |
||
171 | * @param \TechDivision\Import\Attribute\Actions\CatalogAttributeAction $catalogAttributeAction The catalog attribute action instance |
||
172 | * @param \TechDivision\Import\Attribute\Actions\EntityAttributeAction $entityAttributeAction The entity attribute action instance |
||
173 | */ |
||
174 | public function __construct( |
||
207 | |||
208 | /** |
||
209 | * Set's the passed connection. |
||
210 | * |
||
211 | * @param \PDO $connection The connection to set |
||
212 | * |
||
213 | * @return void |
||
214 | */ |
||
215 | public function setConnection(\PDO $connection) |
||
219 | |||
220 | /** |
||
221 | * Return's the connection. |
||
222 | * |
||
223 | * @return \PDO The connection instance |
||
224 | */ |
||
225 | public function getConnection() |
||
229 | |||
230 | /** |
||
231 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
232 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
233 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
234 | * to autocommit mode. |
||
235 | * |
||
236 | * @return boolean Returns TRUE on success or FALSE on failure |
||
237 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
238 | */ |
||
239 | public function beginTransaction() |
||
243 | |||
244 | /** |
||
245 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
246 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
247 | * |
||
248 | * @return boolean Returns TRUE on success or FALSE on failure |
||
249 | * @link http://php.net/manual/en/pdo.commit.php |
||
250 | */ |
||
251 | public function commit() |
||
255 | |||
256 | /** |
||
257 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
258 | * |
||
259 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
260 | * rolled back the transaction. |
||
261 | * |
||
262 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
263 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
264 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
265 | * |
||
266 | * @return boolean Returns TRUE on success or FALSE on failure |
||
267 | * @link http://php.net/manual/en/pdo.rollback.php |
||
268 | */ |
||
269 | public function rollBack() |
||
273 | |||
274 | /** |
||
275 | * Set's the attribute repository instance. |
||
276 | * |
||
277 | * @param \TechDivision\Import\Attribute\Repositories\AttributeRepository $attributeRepository The attribute repository instance |
||
278 | * |
||
279 | * @return void |
||
280 | */ |
||
281 | public function setAttributeRepository(AttributeRepository $attributeRepository) |
||
285 | |||
286 | /** |
||
287 | * Return's the attribute repository instance. |
||
288 | * |
||
289 | * @return \TechDivision\Import\Attribute\Repositories\AttributeRepository The attribute repository instance |
||
290 | */ |
||
291 | public function getAttributeRepository() |
||
295 | |||
296 | /** |
||
297 | * Set's the attribute label repository instance. |
||
298 | * |
||
299 | * @param \TechDivision\Import\Attribute\Repositories\AttributeLabelRepository $attributeLabelRepository The attribute label repository instance |
||
300 | * |
||
301 | * @return void |
||
302 | */ |
||
303 | public function setAttributeLabelRepository(AttributeLabelRepository $attributeLabelRepository) |
||
307 | |||
308 | /** |
||
309 | * Return's the attribute label repository instance. |
||
310 | * |
||
311 | * @return \TechDivision\Import\Attribute\Repositories\AttributeRepository The attribute label repository instance |
||
312 | */ |
||
313 | public function getAttributeLabelRepository() |
||
317 | |||
318 | /** |
||
319 | * Set's the attribute option repository instance. |
||
320 | * |
||
321 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository The attribute option repository instance |
||
322 | * |
||
323 | * @return void |
||
324 | */ |
||
325 | public function setAttributeOptionRepository(AttributeOptionRepository $attributeOptionRepository) |
||
329 | |||
330 | /** |
||
331 | * Return's the attribute option repository instance. |
||
332 | * |
||
333 | * @return \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository The attribute option repository instance |
||
334 | */ |
||
335 | public function getAttributeOptionRepository() |
||
339 | |||
340 | /** |
||
341 | * Set's the repository to access EAV attribute option values. |
||
342 | * |
||
343 | * @param \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository The repository to access EAV attribute option values |
||
344 | * |
||
345 | * @return void |
||
346 | */ |
||
347 | public function setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository) |
||
348 | { |
||
349 | $this->eavAttributeOptionValueRepository = $eavAttributeOptionValueRepository; |
||
350 | } |
||
351 | |||
352 | /** |
||
353 | * Return's the repository to access EAV attribute option values. |
||
354 | * |
||
355 | * @return \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository The repository instance |
||
356 | */ |
||
357 | public function getEavAttributeOptionValueRepository() |
||
358 | { |
||
359 | return $this->eavAttributeOptionValueRepository; |
||
360 | } |
||
361 | |||
362 | /** |
||
363 | * Set's the attribute option swatch repository instance. |
||
364 | * |
||
365 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository $attributeOptionSwatchRepository The attribute option swatch repository instance |
||
366 | * |
||
367 | * @return void |
||
368 | */ |
||
369 | public function setAttributeOptionSwatchRepository(AttributeOptionSwatchRepository $attributeOptionSwatchRepository) |
||
373 | |||
374 | /** |
||
375 | * Return's the attribute option swatch repository instance. |
||
376 | * |
||
377 | * @return \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository The attribute option swatch repository instance |
||
378 | */ |
||
379 | public function getAttributeOptionSwatchRepository() |
||
383 | |||
384 | /** |
||
385 | * Set's the catalog attribute repository instance. |
||
386 | * |
||
387 | * @param \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository $catalogAttributeRepository The catalog attribute repository instance |
||
388 | * |
||
389 | * @return void |
||
390 | */ |
||
391 | public function setCatalogAttributeRepository(CatalogAttributeRepository $catalogAttributeRepository) |
||
395 | |||
396 | /** |
||
397 | * Return's the catalog attribute repository instance. |
||
398 | * |
||
399 | * @return \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository The catalog attribute repository instance |
||
400 | */ |
||
401 | public function getCatalogAttributeRepository() |
||
405 | |||
406 | /** |
||
407 | * Set's the entity attribute repository instance. |
||
408 | * |
||
409 | * @param \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository $entityAttributeRepository The entity attribute repository instance |
||
410 | * |
||
411 | * @return void |
||
412 | */ |
||
413 | public function setEntityAttributeRepository(EntityAttributeRepository $entityAttributeRepository) |
||
417 | |||
418 | /** |
||
419 | * Return's the entity attribute repository instance. |
||
420 | * |
||
421 | * @return \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository The entity attribute repository instance |
||
422 | */ |
||
423 | public function getEntityAttributeRepository() |
||
427 | |||
428 | /** |
||
429 | * Set's the attribute action instance. |
||
430 | * |
||
431 | * @param \TechDivision\Import\Attribute\Actions\AttributeAction $attributeAction The attribute action instance |
||
432 | * |
||
433 | * @return void |
||
434 | */ |
||
435 | public function setAttributeAction(AttributeAction $attributeAction) |
||
439 | |||
440 | /** |
||
441 | * Return's the attribute action instance. |
||
442 | * |
||
443 | * @return \TechDivision\Import\Attribute\Actions\AttributeAction The attribute action instance |
||
444 | */ |
||
445 | public function getAttributeAction() |
||
449 | |||
450 | /** |
||
451 | * Set's the attribute label action instance. |
||
452 | * |
||
453 | * @param \TechDivision\Import\Attribute\Actions\AttributeLabelAction $attributeLabelAction The attribute label action instance |
||
454 | * |
||
455 | * @return void |
||
456 | */ |
||
457 | public function setAttributeLabelAction(AttributeLabelAction $attributeLabelAction) |
||
461 | |||
462 | /** |
||
463 | * Return's the attribute label action instance. |
||
464 | * |
||
465 | * @return \TechDivision\Import\Attribute\Actions\AttributeAction The attribute label action instance |
||
466 | */ |
||
467 | public function getAttributeLabelAction() |
||
471 | |||
472 | /** |
||
473 | * Set's the attribute option action instance. |
||
474 | * |
||
475 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionAction $attributeOptionAction The attribute option action instance |
||
476 | * |
||
477 | * @return void |
||
478 | */ |
||
479 | public function setAttributeOptionAction(AttributeOptionAction $attributeOptionAction) |
||
483 | |||
484 | /** |
||
485 | * Return's the attribute option action instance. |
||
486 | * |
||
487 | * @return \TechDivision\Import\Attribute\Actions\AttributeOptionAction The attribute option action instance |
||
488 | */ |
||
489 | public function getAttributeOptionAction() |
||
493 | |||
494 | /** |
||
495 | * Set's the attribute option value action instance. |
||
496 | * |
||
497 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction $attributeOptionValueAction The attribute option value action instance |
||
498 | * |
||
499 | * @return void |
||
500 | */ |
||
501 | public function setAttributeOptionValueAction(AttributeOptionValueAction $attributeOptionValueAction) |
||
505 | |||
506 | /** |
||
507 | * Return's the attribute option value action instance. |
||
508 | * |
||
509 | * @return \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction The attribute option value action instance |
||
510 | */ |
||
511 | public function getAttributeOptionValueAction() |
||
515 | |||
516 | /** |
||
517 | * Set's the attribute option swatch action instance. |
||
518 | * |
||
519 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction $attributeOptionSwatchAction The attribute option swatch action instance |
||
520 | * |
||
521 | * @return void |
||
522 | */ |
||
523 | public function setAttributeOptionSwatchAction(AttributeOptionSwatchAction $attributeOptionSwatchAction) |
||
527 | |||
528 | /** |
||
529 | * Return's the attribute option swatch action instance. |
||
530 | * |
||
531 | * @return \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction The attribute option swatch action instance |
||
532 | */ |
||
533 | public function getAttributeOptionSwatchAction() |
||
537 | |||
538 | /** |
||
539 | * Set's the catalog attribute action instance. |
||
540 | * |
||
541 | * @param \TechDivision\Import\Attribute\Actions\CatalogAttributeAction $catalogAttributeAction The catalog attribute action instance |
||
542 | * |
||
543 | * @return void |
||
544 | */ |
||
545 | public function setCatalogAttributeAction(CatalogAttributeAction $catalogAttributeAction) |
||
549 | |||
550 | /** |
||
551 | * Return's the catalog attribute action instance. |
||
552 | * |
||
553 | * @return \TechDivision\Import\Attribute\Actions\CatalogAttributeAction The catalog attribute action instance |
||
554 | */ |
||
555 | public function getCatalogAttributeAction() |
||
559 | |||
560 | /** |
||
561 | * Set's the entity attribute action instance. |
||
562 | * |
||
563 | * @param \TechDivision\Import\Attribute\Actions\EntityAttributeAction $entityAttributeAction The entity attribute action instance |
||
564 | * |
||
565 | * @return void |
||
566 | */ |
||
567 | public function setEntityAttributeAction(EntityAttributeAction $entityAttributeAction) |
||
571 | |||
572 | /** |
||
573 | * Return's the entity attribute action instance. |
||
574 | * |
||
575 | * @return \TechDivision\Import\Attribute\Actions\EntityAttributeAction The entity attribute action instance |
||
576 | */ |
||
577 | public function getEntityAttributeAction() |
||
581 | |||
582 | /** |
||
583 | * Load's and return's the EAV attribute with the passed code. |
||
584 | * |
||
585 | * @param string $attributeCode The code of the EAV attribute to load |
||
586 | * |
||
587 | * @return array The EAV attribute |
||
588 | */ |
||
589 | public function loadAttributeByAttributeCode($attributeCode) |
||
593 | |||
594 | /** |
||
595 | * Return's the EAV attribute label with the passed attribute code and store ID. |
||
596 | * |
||
597 | * @param string $attributeCode The attribute code of the EAV attribute label to return |
||
598 | * @param integer $storeId The store ID of the EAV attribute label to return |
||
599 | * |
||
600 | * @return array The EAV attribute label |
||
601 | */ |
||
602 | public function loadAttributeLabelByAttributeCodeAndStoreId($attributeCode, $storeId) |
||
606 | |||
607 | /** |
||
608 | * Load's and return's the EAV attribute option with the passed code, store ID and value. |
||
609 | * |
||
610 | * @param string $attributeCode The code of the EAV attribute option to load |
||
611 | * @param integer $storeId The store ID of the attribute option to load |
||
612 | * @param string $value The value of the attribute option to load |
||
613 | * |
||
614 | * @return array The EAV attribute option |
||
615 | */ |
||
616 | public function loadAttributeOptionByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value) |
||
620 | |||
621 | /** |
||
622 | * Load's and return's the EAV attribute option value with the passed code, store ID and value. |
||
623 | * |
||
624 | * @param string $attributeCode The code of the EAV attribute option to load |
||
625 | * @param integer $storeId The store ID of the attribute option to load |
||
626 | * @param string $value The value of the attribute option to load |
||
627 | * |
||
628 | * @return array The EAV attribute option value |
||
629 | */ |
||
630 | public function loadAttributeOptionValueByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value) |
||
634 | |||
635 | /** |
||
636 | * Load's and return's the EAV attribute option swatch with the passed code, store ID, value and type. |
||
637 | * |
||
638 | * @param string $attributeCode The code of the EAV attribute option swatch to load |
||
639 | * @param integer $storeId The store ID of the attribute option swatch to load |
||
640 | * @param string $value The value of the attribute option swatch to load |
||
641 | * @param string $type The type of the attribute option swatch to load |
||
642 | * |
||
643 | * @return array The EAV attribute option swatch |
||
644 | */ |
||
645 | public function loadAttributeOptionSwatchByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value, $type) |
||
649 | |||
650 | /** |
||
651 | * Load's and retur's the EAV catalog attribute with the passed ID. |
||
652 | * |
||
653 | * @param string $attributeId The ID of the EAV catalog attribute to return |
||
654 | * |
||
655 | * @return array The EAV catalog attribute |
||
656 | */ |
||
657 | public function loadCatalogAttribute($attributeId) |
||
661 | |||
662 | /** |
||
663 | * Return's the EAV entity attribute with the passed entity type, attribute, attribute set and attribute group ID. |
||
664 | * |
||
665 | * @param integer $entityTypeId The ID of the EAV entity attribute's entity type to return |
||
666 | * @param integer $attributeId The ID of the EAV entity attribute's attribute to return |
||
667 | * @param integer $attributeSetId The ID of the EAV entity attribute's attribute set to return |
||
668 | * @param integer $attributeGroupId The ID of the EAV entity attribute's attribute group to return |
||
669 | * |
||
670 | * @return array The EAV entity attribute |
||
671 | */ |
||
672 | public function loadEntityAttributeByEntityTypeAndAttributeIdAndAttributeSetIdAndAttributeGroupId($entityTypeId, $attributeId, $attributeSetId, $attributeGroupId) |
||
676 | |||
677 | /** |
||
678 | * Persist's the passed EAV attribute data and return's the ID. |
||
679 | * |
||
680 | * @param array $attribute The attribute data to persist |
||
681 | * @param string|null $name The name of the prepared statement that has to be executed |
||
682 | * |
||
683 | * @return string The ID of the persisted attribute |
||
684 | */ |
||
685 | public function persistAttribute(array $attribute, $name = null) |
||
689 | |||
690 | /** |
||
691 | * Persist the passed attribute label. |
||
692 | * |
||
693 | * @param array $attributeLabel The attribute label to persist |
||
694 | * @param string|null $name The name of the prepared statement that has to be executed |
||
695 | * |
||
696 | * @return void |
||
697 | */ |
||
698 | public function persistAttributeLabel(array $attributeLabel, $name = null) |
||
702 | |||
703 | /** |
||
704 | * Persist's the passed EAV attribute option data and return's the ID. |
||
705 | * |
||
706 | * @param array $attributeOption The attribute option data to persist |
||
707 | * @param string|null $name The name of the prepared statement that has to be executed |
||
708 | * |
||
709 | * @return string The ID of the persisted attribute |
||
710 | */ |
||
711 | public function persistAttributeOption(array $attributeOption, $name = null) |
||
715 | |||
716 | /** |
||
717 | * Persist's the passed EAV attribute option value data and return's the ID. |
||
718 | * |
||
719 | * @param array $attributeOptionValue The attribute option value data to persist |
||
720 | * @param string|null $name The name of the prepared statement that has to be executed |
||
721 | * |
||
722 | * @return void |
||
723 | */ |
||
724 | public function persistAttributeOptionValue(array $attributeOptionValue, $name = null) |
||
728 | |||
729 | /** |
||
730 | * Persist the passed attribute option swatch. |
||
731 | * |
||
732 | * @param array $attributeOptionSwatch The attribute option swatch to persist |
||
733 | * @param string|null $name The name of the prepared statement that has to be executed |
||
734 | * |
||
735 | * @return void |
||
736 | */ |
||
737 | public function persistAttributeOptionSwatch(array $attributeOptionSwatch, $name = null) |
||
741 | |||
742 | /** |
||
743 | * Persist's the passed EAV catalog attribute data and return's the ID. |
||
744 | * |
||
745 | * @param array $catalogAttribute The catalog attribute data to persist |
||
746 | * @param string|null $name The name of the prepared statement that has to be executed |
||
747 | * |
||
748 | * @return void |
||
749 | */ |
||
750 | public function persistCatalogAttribute(array $catalogAttribute, $name = null) |
||
754 | |||
755 | /** |
||
756 | * Persist's the passed EAV entity attribute data and return's the ID. |
||
757 | * |
||
758 | * @param array $entityAttribute The entity attribute data to persist |
||
759 | * @param string|null $name The name of the prepared statement that has to be executed |
||
760 | * |
||
761 | * @return void |
||
762 | */ |
||
763 | public function persistEntityAttribute(array $entityAttribute, $name = null) |
||
767 | |||
768 | /** |
||
769 | * Delete's the EAV attribute with the passed attributes. |
||
770 | * |
||
771 | * @param array $row The attributes of the EAV attribute to delete |
||
772 | * @param string|null $name The name of the prepared statement that has to be executed |
||
773 | * |
||
774 | * @return void |
||
775 | */ |
||
776 | public function deleteAttribute($row, $name = null) |
||
780 | } |
||
781 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: