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 |
||
| 48 | class AttributeBunchProcessor implements AttributeBunchProcessorInterface |
||
| 49 | { |
||
| 50 | |||
| 51 | /** |
||
| 52 | * A connection to use. |
||
| 53 | * |
||
| 54 | * @var \TechDivision\Import\Connection\ConnectionInterface |
||
| 55 | */ |
||
| 56 | protected $connection; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * The attribute repository instance. |
||
| 60 | * |
||
| 61 | * @var \TechDivision\Import\Attribute\Repositories\AttributeRepository |
||
| 62 | */ |
||
| 63 | protected $attributeRepository; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * The attribute label repository instance. |
||
| 67 | * |
||
| 68 | * @var \TechDivision\Import\Attribute\Repositories\AttributeLabelRepository |
||
| 69 | */ |
||
| 70 | protected $attributeLabelRepository; |
||
| 71 | |||
| 72 | /** |
||
| 73 | * The attribute option repository instance. |
||
| 74 | * |
||
| 75 | * @var \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository |
||
| 76 | */ |
||
| 77 | protected $attributeOptionRepository; |
||
| 78 | |||
| 79 | /** |
||
| 80 | * The repository to access EAV attribute option values. |
||
| 81 | * |
||
| 82 | * @var \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository |
||
| 83 | */ |
||
| 84 | protected $eavAttributeOptionValueRepository; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * The attribute option swatch repository instance. |
||
| 88 | * |
||
| 89 | * @var \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository |
||
| 90 | */ |
||
| 91 | protected $attributeOptionSwatchRepository; |
||
| 92 | |||
| 93 | /** |
||
| 94 | * The catalog attribute repository instance. |
||
| 95 | * |
||
| 96 | * @var \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository |
||
| 97 | */ |
||
| 98 | protected $catalogAttributeRepository; |
||
| 99 | |||
| 100 | /** |
||
| 101 | * The entity attribute repository instance. |
||
| 102 | * |
||
| 103 | * @var \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository |
||
| 104 | */ |
||
| 105 | protected $entityAttributeRepository; |
||
| 106 | |||
| 107 | /** |
||
| 108 | * The attribute action instance. |
||
| 109 | * |
||
| 110 | * @var \TechDivision\Import\Attribute\Actions\AttributeAction |
||
| 111 | */ |
||
| 112 | protected $attributeAction; |
||
| 113 | |||
| 114 | /** |
||
| 115 | * The attribute label action instance. |
||
| 116 | * |
||
| 117 | * @var \TechDivision\Import\Attribute\Actions\AttributeLabelAction |
||
| 118 | */ |
||
| 119 | protected $attributeLabelAction; |
||
| 120 | |||
| 121 | /** |
||
| 122 | * The attribute option action instance. |
||
| 123 | * |
||
| 124 | * @var \TechDivision\Import\Attribute\Actions\AttributeOptionAction |
||
| 125 | */ |
||
| 126 | protected $attributeOptionAction; |
||
| 127 | |||
| 128 | /** |
||
| 129 | * The attribute option value action instance. |
||
| 130 | * |
||
| 131 | * @var \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction |
||
| 132 | */ |
||
| 133 | protected $attributeOptionValueAction; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * The attribute option swatch action instance. |
||
| 137 | * |
||
| 138 | * @var \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction |
||
| 139 | */ |
||
| 140 | protected $attributeOptionSwatchAction; |
||
| 141 | |||
| 142 | /** |
||
| 143 | * The attribute action instance. |
||
| 144 | * |
||
| 145 | * @var \TechDivision\Import\Attribute\Actions\CatalogAttributeAction |
||
| 146 | */ |
||
| 147 | protected $catalogAttributeAction; |
||
| 148 | |||
| 149 | /** |
||
| 150 | * The entity attribute action instance. |
||
| 151 | * |
||
| 152 | * @var \TechDivision\Import\Attribute\Actions\EntityAttributeAction |
||
| 153 | */ |
||
| 154 | protected $entityAttributeAction; |
||
| 155 | |||
| 156 | /** |
||
| 157 | * Initialize the processor with the necessary assembler and repository instances. |
||
| 158 | * |
||
| 159 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to use |
||
| 160 | * @param \TechDivision\Import\Attribute\Repositories\AttributeRepository $attributeRepository The attribute repository instance |
||
| 161 | * @param \TechDivision\Import\Attribute\Repositories\AttributeLabelRepository $attributeLabelRepository The attribute label repository instance |
||
| 162 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository The attribute repository instance |
||
| 163 | * @param \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository The EAV attribute option value repository to use |
||
| 164 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository $attributeOptionSwatchRepository The attribute repository swatch instance |
||
| 165 | * @param \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository $catalogAttributeRepository The catalog attribute repository instance |
||
| 166 | * @param \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository $entityAttributeRepository The entity attribute repository instance |
||
| 167 | * @param \TechDivision\Import\Attribute\Actions\AttributeAction $attributeAction The attribute action instance |
||
| 168 | * @param \TechDivision\Import\Attribute\Actions\AttributeLabelAction $attributeLabelAction The attribute label action instance |
||
| 169 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionAction $attributeOptionAction The attribute option action instance |
||
| 170 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction $attributeOptionValueAction The attribute option value action instance |
||
| 171 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction $attributeOptionSwatchAction The attribute option swatch action instance |
||
| 172 | * @param \TechDivision\Import\Attribute\Actions\CatalogAttributeAction $catalogAttributeAction The catalog attribute action instance |
||
| 173 | * @param \TechDivision\Import\Attribute\Actions\EntityAttributeAction $entityAttributeAction The entity attribute action instance |
||
| 174 | */ |
||
| 175 | public function __construct( |
||
| 208 | |||
| 209 | /** |
||
| 210 | * Set's the passed connection. |
||
| 211 | * |
||
| 212 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to set |
||
| 213 | * |
||
| 214 | * @return void |
||
| 215 | */ |
||
| 216 | public function setConnection(ConnectionInterface $connection) |
||
| 220 | |||
| 221 | /** |
||
| 222 | * Return's the connection. |
||
| 223 | * |
||
| 224 | * @return \TechDivision\Import\Connection\ConnectionInterface The connection instance |
||
| 225 | */ |
||
| 226 | public function getConnection() |
||
| 230 | |||
| 231 | /** |
||
| 232 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
| 233 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
| 234 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
| 235 | * to autocommit mode. |
||
| 236 | * |
||
| 237 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 238 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
| 239 | */ |
||
| 240 | public function beginTransaction() |
||
| 244 | |||
| 245 | /** |
||
| 246 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
| 247 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
| 248 | * |
||
| 249 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 250 | * @link http://php.net/manual/en/pdo.commit.php |
||
| 251 | */ |
||
| 252 | public function commit() |
||
| 256 | |||
| 257 | /** |
||
| 258 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
| 259 | * |
||
| 260 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
| 261 | * rolled back the transaction. |
||
| 262 | * |
||
| 263 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
| 264 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
| 265 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
| 266 | * |
||
| 267 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 268 | * @link http://php.net/manual/en/pdo.rollback.php |
||
| 269 | */ |
||
| 270 | public function rollBack() |
||
| 274 | |||
| 275 | /** |
||
| 276 | * Set's the attribute repository instance. |
||
| 277 | * |
||
| 278 | * @param \TechDivision\Import\Attribute\Repositories\AttributeRepository $attributeRepository The attribute repository instance |
||
| 279 | * |
||
| 280 | * @return void |
||
| 281 | */ |
||
| 282 | public function setAttributeRepository(AttributeRepository $attributeRepository) |
||
| 286 | |||
| 287 | /** |
||
| 288 | * Return's the attribute repository instance. |
||
| 289 | * |
||
| 290 | * @return \TechDivision\Import\Attribute\Repositories\AttributeRepository The attribute repository instance |
||
| 291 | */ |
||
| 292 | public function getAttributeRepository() |
||
| 296 | |||
| 297 | /** |
||
| 298 | * Set's the attribute label repository instance. |
||
| 299 | * |
||
| 300 | * @param \TechDivision\Import\Attribute\Repositories\AttributeLabelRepository $attributeLabelRepository The attribute label repository instance |
||
| 301 | * |
||
| 302 | * @return void |
||
| 303 | */ |
||
| 304 | public function setAttributeLabelRepository(AttributeLabelRepository $attributeLabelRepository) |
||
| 308 | |||
| 309 | /** |
||
| 310 | * Return's the attribute label repository instance. |
||
| 311 | * |
||
| 312 | * @return \TechDivision\Import\Attribute\Repositories\AttributeRepository The attribute label repository instance |
||
| 313 | */ |
||
| 314 | public function getAttributeLabelRepository() |
||
| 318 | |||
| 319 | /** |
||
| 320 | * Set's the attribute option repository instance. |
||
| 321 | * |
||
| 322 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository The attribute option repository instance |
||
| 323 | * |
||
| 324 | * @return void |
||
| 325 | */ |
||
| 326 | public function setAttributeOptionRepository(AttributeOptionRepository $attributeOptionRepository) |
||
| 330 | |||
| 331 | /** |
||
| 332 | * Return's the attribute option repository instance. |
||
| 333 | * |
||
| 334 | * @return \TechDivision\Import\Attribute\Repositories\AttributeOptionRepository The attribute option repository instance |
||
| 335 | */ |
||
| 336 | public function getAttributeOptionRepository() |
||
| 340 | |||
| 341 | /** |
||
| 342 | * Set's the repository to access EAV attribute option values. |
||
| 343 | * |
||
| 344 | * @param \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository The repository to access EAV attribute option values |
||
| 345 | * |
||
| 346 | * @return void |
||
| 347 | */ |
||
| 348 | public function setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository) |
||
| 352 | |||
| 353 | /** |
||
| 354 | * Return's the repository to access EAV attribute option values. |
||
| 355 | * |
||
| 356 | * @return \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository The repository instance |
||
| 357 | */ |
||
| 358 | public function getEavAttributeOptionValueRepository() |
||
| 362 | |||
| 363 | /** |
||
| 364 | * Set's the attribute option swatch repository instance. |
||
| 365 | * |
||
| 366 | * @param \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository $attributeOptionSwatchRepository The attribute option swatch repository instance |
||
| 367 | * |
||
| 368 | * @return void |
||
| 369 | */ |
||
| 370 | public function setAttributeOptionSwatchRepository(AttributeOptionSwatchRepository $attributeOptionSwatchRepository) |
||
| 374 | |||
| 375 | /** |
||
| 376 | * Return's the attribute option swatch repository instance. |
||
| 377 | * |
||
| 378 | * @return \TechDivision\Import\Attribute\Repositories\AttributeOptionSwatchRepository The attribute option swatch repository instance |
||
| 379 | */ |
||
| 380 | public function getAttributeOptionSwatchRepository() |
||
| 384 | |||
| 385 | /** |
||
| 386 | * Set's the catalog attribute repository instance. |
||
| 387 | * |
||
| 388 | * @param \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository $catalogAttributeRepository The catalog attribute repository instance |
||
| 389 | * |
||
| 390 | * @return void |
||
| 391 | */ |
||
| 392 | public function setCatalogAttributeRepository(CatalogAttributeRepository $catalogAttributeRepository) |
||
| 396 | |||
| 397 | /** |
||
| 398 | * Return's the catalog attribute repository instance. |
||
| 399 | * |
||
| 400 | * @return \TechDivision\Import\Attribute\Repositories\CatalogAttributeRepository The catalog attribute repository instance |
||
| 401 | */ |
||
| 402 | public function getCatalogAttributeRepository() |
||
| 406 | |||
| 407 | /** |
||
| 408 | * Set's the entity attribute repository instance. |
||
| 409 | * |
||
| 410 | * @param \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository $entityAttributeRepository The entity attribute repository instance |
||
| 411 | * |
||
| 412 | * @return void |
||
| 413 | */ |
||
| 414 | public function setEntityAttributeRepository(EntityAttributeRepository $entityAttributeRepository) |
||
| 418 | |||
| 419 | /** |
||
| 420 | * Return's the entity attribute repository instance. |
||
| 421 | * |
||
| 422 | * @return \TechDivision\Import\Attribute\Repositories\EntityAttributeRepository The entity attribute repository instance |
||
| 423 | */ |
||
| 424 | public function getEntityAttributeRepository() |
||
| 428 | |||
| 429 | /** |
||
| 430 | * Set's the attribute action instance. |
||
| 431 | * |
||
| 432 | * @param \TechDivision\Import\Attribute\Actions\AttributeAction $attributeAction The attribute action instance |
||
| 433 | * |
||
| 434 | * @return void |
||
| 435 | */ |
||
| 436 | public function setAttributeAction(AttributeAction $attributeAction) |
||
| 440 | |||
| 441 | /** |
||
| 442 | * Return's the attribute action instance. |
||
| 443 | * |
||
| 444 | * @return \TechDivision\Import\Attribute\Actions\AttributeAction The attribute action instance |
||
| 445 | */ |
||
| 446 | public function getAttributeAction() |
||
| 450 | |||
| 451 | /** |
||
| 452 | * Set's the attribute label action instance. |
||
| 453 | * |
||
| 454 | * @param \TechDivision\Import\Attribute\Actions\AttributeLabelAction $attributeLabelAction The attribute label action instance |
||
| 455 | * |
||
| 456 | * @return void |
||
| 457 | */ |
||
| 458 | public function setAttributeLabelAction(AttributeLabelAction $attributeLabelAction) |
||
| 462 | |||
| 463 | /** |
||
| 464 | * Return's the attribute label action instance. |
||
| 465 | * |
||
| 466 | * @return \TechDivision\Import\Attribute\Actions\AttributeAction The attribute label action instance |
||
| 467 | */ |
||
| 468 | public function getAttributeLabelAction() |
||
| 472 | |||
| 473 | /** |
||
| 474 | * Set's the attribute option action instance. |
||
| 475 | * |
||
| 476 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionAction $attributeOptionAction The attribute option action instance |
||
| 477 | * |
||
| 478 | * @return void |
||
| 479 | */ |
||
| 480 | public function setAttributeOptionAction(AttributeOptionAction $attributeOptionAction) |
||
| 484 | |||
| 485 | /** |
||
| 486 | * Return's the attribute option action instance. |
||
| 487 | * |
||
| 488 | * @return \TechDivision\Import\Attribute\Actions\AttributeOptionAction The attribute option action instance |
||
| 489 | */ |
||
| 490 | public function getAttributeOptionAction() |
||
| 494 | |||
| 495 | /** |
||
| 496 | * Set's the attribute option value action instance. |
||
| 497 | * |
||
| 498 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction $attributeOptionValueAction The attribute option value action instance |
||
| 499 | * |
||
| 500 | * @return void |
||
| 501 | */ |
||
| 502 | public function setAttributeOptionValueAction(AttributeOptionValueAction $attributeOptionValueAction) |
||
| 506 | |||
| 507 | /** |
||
| 508 | * Return's the attribute option value action instance. |
||
| 509 | * |
||
| 510 | * @return \TechDivision\Import\Attribute\Actions\AttributeOptionValueAction The attribute option value action instance |
||
| 511 | */ |
||
| 512 | public function getAttributeOptionValueAction() |
||
| 516 | |||
| 517 | /** |
||
| 518 | * Set's the attribute option swatch action instance. |
||
| 519 | * |
||
| 520 | * @param \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction $attributeOptionSwatchAction The attribute option swatch action instance |
||
| 521 | * |
||
| 522 | * @return void |
||
| 523 | */ |
||
| 524 | public function setAttributeOptionSwatchAction(AttributeOptionSwatchAction $attributeOptionSwatchAction) |
||
| 528 | |||
| 529 | /** |
||
| 530 | * Return's the attribute option swatch action instance. |
||
| 531 | * |
||
| 532 | * @return \TechDivision\Import\Attribute\Actions\AttributeOptionSwatchAction The attribute option swatch action instance |
||
| 533 | */ |
||
| 534 | public function getAttributeOptionSwatchAction() |
||
| 538 | |||
| 539 | /** |
||
| 540 | * Set's the catalog attribute action instance. |
||
| 541 | * |
||
| 542 | * @param \TechDivision\Import\Attribute\Actions\CatalogAttributeAction $catalogAttributeAction The catalog attribute action instance |
||
| 543 | * |
||
| 544 | * @return void |
||
| 545 | */ |
||
| 546 | public function setCatalogAttributeAction(CatalogAttributeAction $catalogAttributeAction) |
||
| 550 | |||
| 551 | /** |
||
| 552 | * Return's the catalog attribute action instance. |
||
| 553 | * |
||
| 554 | * @return \TechDivision\Import\Attribute\Actions\CatalogAttributeAction The catalog attribute action instance |
||
| 555 | */ |
||
| 556 | public function getCatalogAttributeAction() |
||
| 560 | |||
| 561 | /** |
||
| 562 | * Set's the entity attribute action instance. |
||
| 563 | * |
||
| 564 | * @param \TechDivision\Import\Attribute\Actions\EntityAttributeAction $entityAttributeAction The entity attribute action instance |
||
| 565 | * |
||
| 566 | * @return void |
||
| 567 | */ |
||
| 568 | public function setEntityAttributeAction(EntityAttributeAction $entityAttributeAction) |
||
| 572 | |||
| 573 | /** |
||
| 574 | * Return's the entity attribute action instance. |
||
| 575 | * |
||
| 576 | * @return \TechDivision\Import\Attribute\Actions\EntityAttributeAction The entity attribute action instance |
||
| 577 | */ |
||
| 578 | public function getEntityAttributeAction() |
||
| 582 | |||
| 583 | /** |
||
| 584 | * Load's and return's the EAV attribute with the passed code. |
||
| 585 | * |
||
| 586 | * @param string $attributeCode The code of the EAV attribute to load |
||
| 587 | * |
||
| 588 | * @return array The EAV attribute |
||
| 589 | */ |
||
| 590 | public function loadAttributeByAttributeCode($attributeCode) |
||
| 594 | |||
| 595 | /** |
||
| 596 | * Return's the EAV attribute label with the passed attribute code and store ID. |
||
| 597 | * |
||
| 598 | * @param string $attributeCode The attribute code of the EAV attribute label to return |
||
| 599 | * @param integer $storeId The store ID of the EAV attribute label to return |
||
| 600 | * |
||
| 601 | * @return array The EAV attribute label |
||
| 602 | */ |
||
| 603 | public function loadAttributeLabelByAttributeCodeAndStoreId($attributeCode, $storeId) |
||
| 607 | |||
| 608 | /** |
||
| 609 | * Load's and return's the EAV attribute option with the passed code, store ID and value. |
||
| 610 | * |
||
| 611 | * @param string $attributeCode The code of the EAV attribute option to load |
||
| 612 | * @param integer $storeId The store ID of the attribute option to load |
||
| 613 | * @param string $value The value of the attribute option to load |
||
| 614 | * |
||
| 615 | * @return array The EAV attribute option |
||
| 616 | */ |
||
| 617 | public function loadAttributeOptionByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value) |
||
| 621 | |||
| 622 | /** |
||
| 623 | * Load's and return's the EAV attribute option value with the passed code, store ID and value. |
||
| 624 | * |
||
| 625 | * @param string $attributeCode The code of the EAV attribute option to load |
||
| 626 | * @param integer $storeId The store ID of the attribute option to load |
||
| 627 | * @param string $value The value of the attribute option to load |
||
| 628 | * |
||
| 629 | * @return array The EAV attribute option value |
||
| 630 | */ |
||
| 631 | public function loadAttributeOptionValueByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value) |
||
| 635 | |||
| 636 | /** |
||
| 637 | * Load's and return's the EAV attribute option value with the passed option ID and store ID. |
||
| 638 | * |
||
| 639 | * @param string $optionId The option ID |
||
| 640 | * @param integer $storeId The store ID of the attribute option to load |
||
| 641 | * |
||
| 642 | * @return array The EAV attribute option value |
||
| 643 | */ |
||
| 644 | public function loadAttributeOptionValueByOptionIdAndStoreId($optionId, $storeId) |
||
| 648 | |||
| 649 | /** |
||
| 650 | * Load's and return's the EAV attribute option swatch with the passed code, store ID, value and type. |
||
| 651 | * |
||
| 652 | * @param string $attributeCode The code of the EAV attribute option swatch to load |
||
| 653 | * @param integer $storeId The store ID of the attribute option swatch to load |
||
| 654 | * @param string $value The value of the attribute option swatch to load |
||
| 655 | * @param string $type The type of the attribute option swatch to load |
||
| 656 | * |
||
| 657 | * @return array The EAV attribute option swatch |
||
| 658 | */ |
||
| 659 | public function loadAttributeOptionSwatchByAttributeCodeAndStoreIdAndValue($attributeCode, $storeId, $value, $type) |
||
| 663 | |||
| 664 | /** |
||
| 665 | * Load's and retur's the EAV catalog attribute with the passed ID. |
||
| 666 | * |
||
| 667 | * @param string $attributeId The ID of the EAV catalog attribute to return |
||
| 668 | * |
||
| 669 | * @return array The EAV catalog attribute |
||
| 670 | */ |
||
| 671 | public function loadCatalogAttribute($attributeId) |
||
| 675 | |||
| 676 | /** |
||
| 677 | * Return's the EAV entity attribute with the passed entity type, attribute, attribute set and attribute group ID. |
||
| 678 | * |
||
| 679 | * @param integer $entityTypeId The ID of the EAV entity attribute's entity type to return |
||
| 680 | * @param integer $attributeId The ID of the EAV entity attribute's attribute to return |
||
| 681 | * @param integer $attributeSetId The ID of the EAV entity attribute's attribute set to return |
||
| 682 | * @param integer $attributeGroupId The ID of the EAV entity attribute's attribute group to return |
||
| 683 | * |
||
| 684 | * @return array The EAV entity attribute |
||
| 685 | */ |
||
| 686 | public function loadEntityAttributeByEntityTypeAndAttributeIdAndAttributeSetIdAndAttributeGroupId($entityTypeId, $attributeId, $attributeSetId, $attributeGroupId) |
||
| 690 | |||
| 691 | /** |
||
| 692 | * Persist's the passed EAV attribute data and return's the ID. |
||
| 693 | * |
||
| 694 | * @param array $attribute The attribute data to persist |
||
| 695 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 696 | * |
||
| 697 | * @return string The ID of the persisted attribute |
||
| 698 | */ |
||
| 699 | public function persistAttribute(array $attribute, $name = null) |
||
| 703 | |||
| 704 | /** |
||
| 705 | * Persist the passed attribute label. |
||
| 706 | * |
||
| 707 | * @param array $attributeLabel The attribute label to persist |
||
| 708 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 709 | * |
||
| 710 | * @return void |
||
| 711 | */ |
||
| 712 | public function persistAttributeLabel(array $attributeLabel, $name = null) |
||
| 716 | |||
| 717 | /** |
||
| 718 | * Persist's the passed EAV attribute option data and return's the ID. |
||
| 719 | * |
||
| 720 | * @param array $attributeOption The attribute option data to persist |
||
| 721 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 722 | * |
||
| 723 | * @return string The ID of the persisted attribute |
||
| 724 | */ |
||
| 725 | public function persistAttributeOption(array $attributeOption, $name = null) |
||
| 729 | |||
| 730 | /** |
||
| 731 | * Persist's the passed EAV attribute option value data and return's the ID. |
||
| 732 | * |
||
| 733 | * @param array $attributeOptionValue The attribute option value data to persist |
||
| 734 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 735 | * |
||
| 736 | * @return void |
||
| 737 | */ |
||
| 738 | public function persistAttributeOptionValue(array $attributeOptionValue, $name = null) |
||
| 742 | |||
| 743 | /** |
||
| 744 | * Persist the passed attribute option swatch. |
||
| 745 | * |
||
| 746 | * @param array $attributeOptionSwatch The attribute option swatch to persist |
||
| 747 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 748 | * |
||
| 749 | * @return void |
||
| 750 | */ |
||
| 751 | public function persistAttributeOptionSwatch(array $attributeOptionSwatch, $name = null) |
||
| 755 | |||
| 756 | /** |
||
| 757 | * Persist's the passed EAV catalog attribute data and return's the ID. |
||
| 758 | * |
||
| 759 | * @param array $catalogAttribute The catalog attribute data to persist |
||
| 760 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 761 | * |
||
| 762 | * @return void |
||
| 763 | */ |
||
| 764 | public function persistCatalogAttribute(array $catalogAttribute, $name = null) |
||
| 768 | |||
| 769 | /** |
||
| 770 | * Persist's the passed EAV entity attribute data and return's the ID. |
||
| 771 | * |
||
| 772 | * @param array $entityAttribute The entity attribute data to persist |
||
| 773 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 774 | * |
||
| 775 | * @return void |
||
| 776 | */ |
||
| 777 | public function persistEntityAttribute(array $entityAttribute, $name = null) |
||
| 781 | |||
| 782 | /** |
||
| 783 | * Delete's the EAV attribute with the passed attributes. |
||
| 784 | * |
||
| 785 | * @param array $row The attributes of the EAV attribute to delete |
||
| 786 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 787 | * |
||
| 788 | * @return void |
||
| 789 | */ |
||
| 790 | public function deleteAttribute($row, $name = null) |
||
| 794 | } |
||
| 795 |
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: