Complex classes like ImportProcessor 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 ImportProcessor, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 52 | class ImportProcessor implements ImportProcessorInterface |
||
| 53 | { |
||
| 54 | |||
| 55 | /** |
||
| 56 | * A connection to use. |
||
| 57 | * |
||
| 58 | * @var \TechDivision\Import\Connection\ConnectionInterface |
||
| 59 | */ |
||
| 60 | protected $connection; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * The category assembler instance. |
||
| 64 | * |
||
| 65 | * @var \TechDivision\Import\Assembler\CategoryAssembler |
||
| 66 | */ |
||
| 67 | protected $categoryAssembler; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * The repository to access categories. |
||
| 71 | * |
||
| 72 | * @var \TechDivision\Import\Repositories\CategoryRepository |
||
| 73 | */ |
||
| 74 | protected $categoryRepository; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * The repository to access category varchar values. |
||
| 78 | * |
||
| 79 | * @var \TechDivision\Import\Repositories\CategoryVarcharRepository |
||
| 80 | */ |
||
| 81 | protected $categoryVarcharRepository; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * The repository to access EAV attributes. |
||
| 85 | * |
||
| 86 | * @var \TechDivision\Import\Repositories\EavAttributeRepository |
||
| 87 | */ |
||
| 88 | protected $eavAttributeRepository; |
||
| 89 | |||
| 90 | /** |
||
| 91 | * The repository to access EAV attribute sets. |
||
| 92 | * |
||
| 93 | * @var \TechDivision\Import\Repositories\EavAttributeSetRepository |
||
| 94 | */ |
||
| 95 | protected $eavAttributeSetRepository; |
||
| 96 | |||
| 97 | /** |
||
| 98 | * The repository to access EAV attribute groups. |
||
| 99 | * |
||
| 100 | * @var \TechDivision\Import\Repositories\EavAttributeGroupRepository |
||
| 101 | */ |
||
| 102 | protected $eavAttributeGroupRepository; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * The repository to access EAV entity types. |
||
| 106 | * |
||
| 107 | * @var \TechDivision\Import\Repositories\EavEntityTypeRepository |
||
| 108 | */ |
||
| 109 | protected $eavEntityTypeRepository; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * The repository to access stores. |
||
| 113 | * |
||
| 114 | * @var \TechDivision\Import\Repositories\StoreRepository |
||
| 115 | */ |
||
| 116 | protected $storeRepository; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * The repository to access store websites. |
||
| 120 | * |
||
| 121 | * @var \TechDivision\Import\Repositories\StoreWebsiteRepository |
||
| 122 | */ |
||
| 123 | protected $storeWebsiteRepository; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * The repository to access tax classes. |
||
| 127 | * |
||
| 128 | * @var \TechDivision\Import\Repositories\TaxClassRepository |
||
| 129 | */ |
||
| 130 | protected $taxClassRepository; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * The repository to access link types. |
||
| 134 | * |
||
| 135 | * @var \TechDivision\Import\Repositories\LinkTypeRepository |
||
| 136 | */ |
||
| 137 | protected $linkTypeRepository; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * The repository to access link attributes. |
||
| 141 | * |
||
| 142 | * @var \TechDivision\Import\Repositories\LinkAttributeRepository |
||
| 143 | */ |
||
| 144 | protected $linkAttributeRepository; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * The repository to access the configuration. |
||
| 148 | * |
||
| 149 | * @var \TechDivision\Import\Repositories\CoreConfigDataRepository |
||
| 150 | */ |
||
| 151 | protected $coreConfigDataRepository; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * The action for store CRUD methods. |
||
| 155 | * |
||
| 156 | * @var \TechDivision\Import\Actions\StoreAction |
||
| 157 | */ |
||
| 158 | protected $storeAction; |
||
| 159 | |||
| 160 | /** |
||
| 161 | * The action for store group CRUD methods. |
||
| 162 | * |
||
| 163 | * @var \TechDivision\Import\Actions\StoreGroupAction |
||
| 164 | */ |
||
| 165 | protected $storeGroupAction; |
||
| 166 | |||
| 167 | /** |
||
| 168 | * The action for store website CRUD methods. |
||
| 169 | * |
||
| 170 | * @var \TechDivision\Import\Actions\StoreWebsiteAction |
||
| 171 | */ |
||
| 172 | protected $storeWebsiteAction; |
||
| 173 | |||
| 174 | /** |
||
| 175 | * Initialize the processor with the necessary assembler and repository instances. |
||
| 176 | * |
||
| 177 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to use |
||
| 178 | * @param \TechDivision\Import\Assembler\CategoryAssembler $categoryAssembler The category assembler instance |
||
| 179 | * @param \TechDivision\Import\Repositories\CategoryRepository $categoryRepository The repository to access categories |
||
| 180 | * @param \TechDivision\Import\Repositories\CategoryVarcharRepository $categoryVarcharRepository The repository to access category varchar values |
||
| 181 | * @param \TechDivision\Import\Repositories\EavAttributeRepository $eavAttributeRepository The repository to access EAV attributes |
||
| 182 | * @param \TechDivision\Import\Repositories\EavAttributeSetRepository $eavAttributeSetRepository The repository to access EAV attribute sets |
||
| 183 | * @param \TechDivision\Import\Repositories\EavAttributeGroupRepository $eavAttributeGroupRepository The repository to access EAV attribute groups |
||
| 184 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepository $eavEntityTypeRepository The repository to access EAV entity types |
||
| 185 | * @param \TechDivision\Import\Repositories\StoreRepository $storeRepository The repository to access stores |
||
| 186 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepository $storeWebsiteRepository The repository to access store websites |
||
| 187 | * @param \TechDivision\Import\Repositories\TaxClassRepository $taxClassRepository The repository to access tax classes |
||
| 188 | * @param \TechDivision\Import\Repositories\LinkTypeRepository $linkTypeRepository The repository to access link types |
||
| 189 | * @param \TechDivision\Import\Repositories\LinkAttributeRepository $linkAttributeRepository The repository to access link attributes |
||
| 190 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepository $coreConfigDataRepository The repository to access the configuration |
||
| 191 | * @param \TechDivision\Import\Actions\StoreAction $storeAction The action with the store CRUD methods |
||
| 192 | * @param \TechDivision\Import\Actions\StoreGroupAction $storeGroupAction The action with the store group CRUD methods |
||
| 193 | * @param \TechDivision\Import\Actions\StoreWebsiteAction $storeWebsiteAction The action with the store website CRUD methods |
||
| 194 | */ |
||
| 195 | public function __construct( |
||
| 232 | |||
| 233 | /** |
||
| 234 | * Set's the passed connection. |
||
| 235 | * |
||
| 236 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection to set |
||
| 237 | * |
||
| 238 | * @return void |
||
| 239 | */ |
||
| 240 | public function setConnection(ConnectionInterface $connection) |
||
| 244 | |||
| 245 | /** |
||
| 246 | * Return's the connection. |
||
| 247 | * |
||
| 248 | * @return \TechDivision\Import\Connection\ConnectionInterface The connection instance |
||
| 249 | */ |
||
| 250 | public function getConnection() |
||
| 254 | |||
| 255 | /** |
||
| 256 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
| 257 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
| 258 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
| 259 | * to autocommit mode. |
||
| 260 | * |
||
| 261 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 262 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
| 263 | */ |
||
| 264 | public function beginTransaction() |
||
| 268 | |||
| 269 | /** |
||
| 270 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
| 271 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
| 272 | * |
||
| 273 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 274 | * @link http://php.net/manual/en/pdo.commit.php |
||
| 275 | */ |
||
| 276 | public function commit() |
||
| 280 | |||
| 281 | /** |
||
| 282 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
| 283 | * |
||
| 284 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
| 285 | * rolled back the transaction. |
||
| 286 | * |
||
| 287 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
| 288 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
| 289 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
| 290 | * |
||
| 291 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 292 | * @link http://php.net/manual/en/pdo.rollback.php |
||
| 293 | */ |
||
| 294 | public function rollBack() |
||
| 298 | |||
| 299 | /** |
||
| 300 | * Set's the category assembler. |
||
| 301 | * |
||
| 302 | * @param \TechDivision\Import\Assembler\CategoryAssembler $categoryAssembler The category assembler |
||
| 303 | * |
||
| 304 | * @return void |
||
| 305 | */ |
||
| 306 | public function setCategoryAssembler($categoryAssembler) |
||
| 310 | |||
| 311 | /** |
||
| 312 | * Return's the category assembler. |
||
| 313 | * |
||
| 314 | * @return \TechDivision\Import\Assembler\CategoryAssembler The category assembler instance |
||
| 315 | */ |
||
| 316 | public function getCategoryAssembler() |
||
| 320 | |||
| 321 | /** |
||
| 322 | * Set's the repository to access categories. |
||
| 323 | * |
||
| 324 | * @param \TechDivision\Import\Repositories\CategoryRepository $categoryRepository The repository to access categories |
||
| 325 | * |
||
| 326 | * @return void |
||
| 327 | */ |
||
| 328 | public function setCategoryRepository($categoryRepository) |
||
| 332 | |||
| 333 | /** |
||
| 334 | * Return's the repository to access categories. |
||
| 335 | * |
||
| 336 | * @return \TechDivision\Import\Repositories\CategoryRepository The repository instance |
||
| 337 | */ |
||
| 338 | public function getCategoryRepository() |
||
| 342 | |||
| 343 | /** |
||
| 344 | * Return's the repository to access category varchar values. |
||
| 345 | * |
||
| 346 | * @param \TechDivision\Import\Repositories\CategoryVarcharRepository $categoryVarcharRepository The repository instance |
||
| 347 | * |
||
| 348 | * @return void |
||
| 349 | */ |
||
| 350 | public function setCategoryVarcharRepository($categoryVarcharRepository) |
||
| 354 | |||
| 355 | /** |
||
| 356 | * Return's the repository to access category varchar values. |
||
| 357 | * |
||
| 358 | * @return \TechDivision\Import\Repositories\CategoryVarcharRepository The repository instance |
||
| 359 | */ |
||
| 360 | public function getCategoryVarcharRepository() |
||
| 364 | |||
| 365 | /** |
||
| 366 | * Set's the repository to access EAV attributes. |
||
| 367 | * |
||
| 368 | * @param \TechDivision\Import\Repositories\EavAttributeRepository $eavAttributeRepository The repository to access EAV attributes |
||
| 369 | * |
||
| 370 | * @return void |
||
| 371 | */ |
||
| 372 | public function setEavAttributeRepository($eavAttributeRepository) |
||
| 376 | |||
| 377 | /** |
||
| 378 | * Return's the repository to access EAV attributes. |
||
| 379 | * |
||
| 380 | * @return \TechDivision\Import\Repositories\EavAttributeRepository The repository instance |
||
| 381 | */ |
||
| 382 | public function getEavAttributeRepository() |
||
| 386 | |||
| 387 | /** |
||
| 388 | * Set's the repository to access EAV attribute sets. |
||
| 389 | * |
||
| 390 | * @param \TechDivision\Import\Repositories\EavAttributeSetRepository $eavAttributeSetRepository The repository the access EAV attribute sets |
||
| 391 | * |
||
| 392 | * @return void |
||
| 393 | */ |
||
| 394 | public function setEavAttributeSetRepository($eavAttributeSetRepository) |
||
| 398 | |||
| 399 | /** |
||
| 400 | * Return's the repository to access EAV attribute sets. |
||
| 401 | * |
||
| 402 | * @return \TechDivision\Import\Repositories\EavAttributeSetRepository The repository instance |
||
| 403 | */ |
||
| 404 | public function getEavAttributeSetRepository() |
||
| 408 | |||
| 409 | /** |
||
| 410 | * Set's the repository to access EAV attribute groups. |
||
| 411 | * |
||
| 412 | * @param \TechDivision\Import\Repositories\EavAttributeGroupRepository $eavAttributeGroupRepository The repository the access EAV attribute groups |
||
| 413 | * |
||
| 414 | * @return void |
||
| 415 | */ |
||
| 416 | public function setEavAttributeGroupRepository($eavAttributeGroupRepository) |
||
| 420 | |||
| 421 | /** |
||
| 422 | * Return's the repository to access EAV attribute groups. |
||
| 423 | * |
||
| 424 | * @return \TechDivision\Import\Repositories\EavAttributeGroupRepository The repository instance |
||
| 425 | */ |
||
| 426 | public function getEavAttributeGroupRepository() |
||
| 430 | |||
| 431 | /** |
||
| 432 | * Return's the repository to access EAV entity types. |
||
| 433 | * |
||
| 434 | * @return \TechDivision\Import\Repositories\EavEntityTypeRepository The repository instance |
||
| 435 | */ |
||
| 436 | public function getEavEntityTypeRepository() |
||
| 440 | |||
| 441 | /** |
||
| 442 | * Set's the repository to access EAV entity types. |
||
| 443 | * |
||
| 444 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepository $eavEntityTypeRepository The repository the access EAV entity types |
||
| 445 | * |
||
| 446 | * @return void |
||
| 447 | */ |
||
| 448 | public function setEavEntityTypeRepository($eavEntityTypeRepository) |
||
| 452 | |||
| 453 | /** |
||
| 454 | * Set's the repository to access stores. |
||
| 455 | * |
||
| 456 | * @param \TechDivision\Import\Repositories\StoreRepository $storeRepository The repository the access stores |
||
| 457 | * |
||
| 458 | * @return void |
||
| 459 | */ |
||
| 460 | public function setStoreRepository($storeRepository) |
||
| 464 | |||
| 465 | /** |
||
| 466 | * Return's the repository to access stores. |
||
| 467 | * |
||
| 468 | * @return \TechDivision\Import\Repositories\StoreRepository The repository instance |
||
| 469 | */ |
||
| 470 | public function getStoreRepository() |
||
| 474 | |||
| 475 | /** |
||
| 476 | * Set's the repository to access store websites. |
||
| 477 | * |
||
| 478 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepository $storeWebsiteRepository The repository the access store websites |
||
| 479 | * |
||
| 480 | * @return void |
||
| 481 | */ |
||
| 482 | public function setStoreWebsiteRepository($storeWebsiteRepository) |
||
| 486 | |||
| 487 | /** |
||
| 488 | * Return's the repository to access store websites. |
||
| 489 | * |
||
| 490 | * @return \TechDivision\Import\Repositories\StoreWebsiteRepository The repository instance |
||
| 491 | */ |
||
| 492 | public function getStoreWebsiteRepository() |
||
| 496 | |||
| 497 | /** |
||
| 498 | * Set's the repository to access tax classes. |
||
| 499 | * |
||
| 500 | * @param \TechDivision\Import\Repositories\TaxClassRepository $taxClassRepository The repository the access stores |
||
| 501 | * |
||
| 502 | * @return void |
||
| 503 | */ |
||
| 504 | public function setTaxClassRepository($taxClassRepository) |
||
| 508 | |||
| 509 | /** |
||
| 510 | * Return's the repository to access tax classes. |
||
| 511 | * |
||
| 512 | * @return \TechDivision\Import\Repositories\TaxClassRepository The repository instance |
||
| 513 | */ |
||
| 514 | public function getTaxClassRepository() |
||
| 518 | |||
| 519 | /** |
||
| 520 | * Set's the repository to access link types. |
||
| 521 | * |
||
| 522 | * @param \TechDivision\Import\Repositories\LinkTypeRepository $linkTypeRepository The repository to access link types |
||
| 523 | * |
||
| 524 | * @return void |
||
| 525 | */ |
||
| 526 | public function setLinkTypeRepository($linkTypeRepository) |
||
| 530 | |||
| 531 | /** |
||
| 532 | * Return's the repository to access link types. |
||
| 533 | * |
||
| 534 | * @return \TechDivision\Import\Repositories\LinkTypeRepository The repository instance |
||
| 535 | */ |
||
| 536 | public function getLinkTypeRepository() |
||
| 540 | |||
| 541 | /** |
||
| 542 | * Set's the repository to access link attributes. |
||
| 543 | * |
||
| 544 | * @param \TechDivision\Import\Repositories\LinkTypeRepository $linkAttributeRepository The repository to access link attributes |
||
| 545 | * |
||
| 546 | * @return void |
||
| 547 | */ |
||
| 548 | public function setLinkAttributeRepository($linkAttributeRepository) |
||
| 552 | |||
| 553 | /** |
||
| 554 | * Return's the repository to access link attributes. |
||
| 555 | * |
||
| 556 | * @return \TechDivision\Import\Repositories\LinkTypeRepository The repository instance |
||
| 557 | */ |
||
| 558 | public function getLinkAttributeRepository() |
||
| 562 | |||
| 563 | /** |
||
| 564 | * Set's the repository to access the Magento 2 configuration. |
||
| 565 | * |
||
| 566 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepository $coreConfigDataRepository The repository to access the Magento 2 configuration |
||
| 567 | * |
||
| 568 | * @return void |
||
| 569 | */ |
||
| 570 | public function setCoreConfigDataRepository($coreConfigDataRepository) |
||
| 574 | |||
| 575 | /** |
||
| 576 | * Return's the repository to access the Magento 2 configuration. |
||
| 577 | * |
||
| 578 | * @return \TechDivision\Import\Repositories\CoreConfigDataRepository The repository instance |
||
| 579 | */ |
||
| 580 | public function getCoreConfigDataRepository() |
||
| 584 | |||
| 585 | /** |
||
| 586 | * Set's the action with the store CRUD methods. |
||
| 587 | * |
||
| 588 | * @param \TechDivision\Import\Actions\StoreAction $storeAction The action with the store CRUD methods |
||
| 589 | * |
||
| 590 | * @return void |
||
| 591 | */ |
||
| 592 | public function setStoreAction($storeAction) |
||
| 596 | |||
| 597 | /** |
||
| 598 | * Return's the action with the store CRUD methods. |
||
| 599 | * |
||
| 600 | * @return \TechDivision\Import\Actions\StoreAction The action instance |
||
| 601 | */ |
||
| 602 | public function getStoreAction() |
||
| 606 | |||
| 607 | /** |
||
| 608 | * Set's the action with the store group CRUD methods. |
||
| 609 | * |
||
| 610 | * @param \TechDivision\Import\Actions\StoreGroupAction $storeGroupAction The action with the store group CRUD methods |
||
| 611 | * |
||
| 612 | * @return void |
||
| 613 | */ |
||
| 614 | public function setStoreGroupAction($storeGroupAction) |
||
| 618 | |||
| 619 | /** |
||
| 620 | * Return's the action with the store group CRUD methods. |
||
| 621 | * |
||
| 622 | * @return \TechDivision\Import\Actions\StoreGroupAction The action instance |
||
| 623 | */ |
||
| 624 | public function getStoreGroupAction() |
||
| 628 | |||
| 629 | /** |
||
| 630 | * Set's the action with the store website CRUD methods. |
||
| 631 | * |
||
| 632 | * @param \TechDivision\Import\Actions\StoreWebsiteAction $storeWebsiteAction The action with the store website CRUD methods |
||
| 633 | * |
||
| 634 | * @return void |
||
| 635 | */ |
||
| 636 | public function setStoreWebsiteAction($storeWebsiteAction) |
||
| 640 | |||
| 641 | /** |
||
| 642 | * Return's the action with the store website CRUD methods. |
||
| 643 | * |
||
| 644 | * @return \TechDivision\Import\Actions\StoreWebsiteAction The action instance |
||
| 645 | */ |
||
| 646 | public function getStoreWebsiteAction() |
||
| 650 | |||
| 651 | /** |
||
| 652 | * Return's the EAV attribute set with the passed ID. |
||
| 653 | * |
||
| 654 | * @param integer $id The ID of the EAV attribute set to load |
||
| 655 | * |
||
| 656 | * @return array The EAV attribute set |
||
| 657 | */ |
||
| 658 | public function getEavAttributeSet($id) |
||
| 662 | |||
| 663 | /** |
||
| 664 | * Return's the attribute sets for the passed entity type ID. |
||
| 665 | * |
||
| 666 | * @param mixed $entityTypeId The entity type ID to return the attribute sets for |
||
| 667 | * |
||
| 668 | * @return array|boolean The attribute sets for the passed entity type ID |
||
| 669 | */ |
||
| 670 | public function getEavAttributeSetsByEntityTypeId($entityTypeId) |
||
| 674 | |||
| 675 | /** |
||
| 676 | * Return's the attribute groups for the passed attribute set ID, whereas the array |
||
| 677 | * is prepared with the attribute group names as keys. |
||
| 678 | * |
||
| 679 | * @param mixed $attributeSetId The EAV attribute set ID to return the attribute groups for |
||
| 680 | * |
||
| 681 | * @return array|boolean The EAV attribute groups for the passed attribute ID |
||
| 682 | */ |
||
| 683 | public function getEavAttributeGroupsByAttributeSetId($attributeSetId) |
||
| 687 | |||
| 688 | /** |
||
| 689 | * Return's an array with the EAV attributes for the passed entity type ID and attribute set name. |
||
| 690 | * |
||
| 691 | * @param integer $entityTypeId The entity type ID of the EAV attributes to return |
||
| 692 | * @param string $attributeSetName The attribute set name of the EAV attributes to return |
||
| 693 | * |
||
| 694 | * @return array The |
||
| 695 | */ |
||
| 696 | public function getEavAttributesByEntityTypeIdAndAttributeSetName($entityTypeId, $attributeSetName) |
||
| 700 | |||
| 701 | /** |
||
| 702 | * Return's an array with the available EAV attributes for the passed option value and store ID. |
||
| 703 | * |
||
| 704 | * @param string $optionValue The option value of the EAV attributes |
||
| 705 | * @param string $storeId The store ID of the EAV attribues |
||
| 706 | * |
||
| 707 | * @return array The array with all available EAV attributes |
||
| 708 | */ |
||
| 709 | public function getEavAttributesByOptionValueAndStoreId($optionValue, $storeId) |
||
| 713 | |||
| 714 | /** |
||
| 715 | * Return's the first EAV attribute for the passed option value and store ID. |
||
| 716 | * |
||
| 717 | * @param string $optionValue The option value of the EAV attributes |
||
| 718 | * @param string $storeId The store ID of the EAV attribues |
||
| 719 | * |
||
| 720 | * @return array The array with the EAV attribute |
||
| 721 | */ |
||
| 722 | public function getEavAttributeByOptionValueAndStoreId($optionValue, $storeId) |
||
| 726 | |||
| 727 | /** |
||
| 728 | * Return's an array with the available EAV attributes for the passed is user defined flag. |
||
| 729 | * |
||
| 730 | * @param integer $isUserDefined The flag itself |
||
| 731 | * |
||
| 732 | * @return array The array with the EAV attributes matching the passed flag |
||
| 733 | */ |
||
| 734 | public function getEavAttributesByIsUserDefined($isUserDefined = 1) |
||
| 738 | |||
| 739 | /** |
||
| 740 | * Return's an array with the available EAV attributes for the passed is entity type and |
||
| 741 | * user defined flag. |
||
| 742 | * |
||
| 743 | * @param integer $entityTypeId The entity type ID of the EAV attributes to return |
||
| 744 | * @param integer $isUserDefined The flag itself |
||
| 745 | * |
||
| 746 | * @return array The array with the EAV attributes matching the passed entity type and user defined flag |
||
| 747 | */ |
||
| 748 | public function getEavAttributesByEntityTypeIdAndIsUserDefined($entityTypeId, $isUserDefined = 1) |
||
| 752 | |||
| 753 | /** |
||
| 754 | * Return's an array with all available EAV entity types with the entity type code as key. |
||
| 755 | * |
||
| 756 | * @return array The available link types |
||
| 757 | */ |
||
| 758 | public function getEavEntityTypes() |
||
| 762 | |||
| 763 | /** |
||
| 764 | * Return's an array with the available stores. |
||
| 765 | * |
||
| 766 | * @return array The array with the available stores |
||
| 767 | */ |
||
| 768 | public function getStores() |
||
| 772 | |||
| 773 | /** |
||
| 774 | * Return's the default store. |
||
| 775 | * |
||
| 776 | * @return array The default store |
||
| 777 | */ |
||
| 778 | public function getDefaultStore() |
||
| 782 | |||
| 783 | /** |
||
| 784 | * Return's an array with the available store websites. |
||
| 785 | * |
||
| 786 | * @return array The array with the available store websites |
||
| 787 | */ |
||
| 788 | public function getStoreWebsites() |
||
| 792 | |||
| 793 | /** |
||
| 794 | * Return's an array with the available tax classes. |
||
| 795 | * |
||
| 796 | * @return array The array with the available tax classes |
||
| 797 | */ |
||
| 798 | public function getTaxClasses() |
||
| 802 | |||
| 803 | /** |
||
| 804 | * Return's an array with all available categories. |
||
| 805 | * |
||
| 806 | * @return array The available categories |
||
| 807 | */ |
||
| 808 | public function getCategories() |
||
| 812 | |||
| 813 | /** |
||
| 814 | * Return's an array with the root categories with the store code as key. |
||
| 815 | * |
||
| 816 | * @return array The root categories |
||
| 817 | */ |
||
| 818 | public function getRootCategories() |
||
| 822 | |||
| 823 | /** |
||
| 824 | * Returns the category varchar values for the categories with |
||
| 825 | * the passed with the passed entity IDs. |
||
| 826 | * |
||
| 827 | * @param array $entityIds The array with the category IDs |
||
| 828 | * |
||
| 829 | * @return mixed The category varchar values |
||
| 830 | */ |
||
| 831 | public function getCategoryVarcharsByEntityIds(array $entityIds) |
||
| 835 | |||
| 836 | /** |
||
| 837 | * Return's an array with all available link types. |
||
| 838 | * |
||
| 839 | * @return array The available link types |
||
| 840 | */ |
||
| 841 | public function getLinkTypes() |
||
| 845 | |||
| 846 | /** |
||
| 847 | * Return's an array with all available link attributes. |
||
| 848 | * |
||
| 849 | * @return array The available link attributes |
||
| 850 | */ |
||
| 851 | public function getLinkAttributes() |
||
| 855 | |||
| 856 | /** |
||
| 857 | * Return's an array with the Magento 2 configuration. |
||
| 858 | * |
||
| 859 | * @return array The Magento 2 configuration |
||
| 860 | */ |
||
| 861 | public function getCoreConfigData() |
||
| 865 | |||
| 866 | /** |
||
| 867 | * Persist's the passed store. |
||
| 868 | * |
||
| 869 | * @param array $store The store to persist |
||
| 870 | * |
||
| 871 | * @return void |
||
| 872 | */ |
||
| 873 | public function persistStore(array $store) |
||
| 877 | |||
| 878 | /** |
||
| 879 | * Persist's the passed store group. |
||
| 880 | * |
||
| 881 | * @param array $storeGroup The store group to persist |
||
| 882 | * |
||
| 883 | * @return void |
||
| 884 | */ |
||
| 885 | public function persistStoreGroup(array $storeGroup) |
||
| 889 | |||
| 890 | /** |
||
| 891 | * Persist's the passed store website. |
||
| 892 | * |
||
| 893 | * @param array $storeWebsite The store website to persist |
||
| 894 | * |
||
| 895 | * @return void |
||
| 896 | */ |
||
| 897 | public function persistStoreWebsite(array $storeWebsite) |
||
| 901 | |||
| 902 | /** |
||
| 903 | * Returns the array with the global data necessary for the |
||
| 904 | * import process. |
||
| 905 | * |
||
| 906 | * @return array The array with the global data |
||
| 907 | */ |
||
| 908 | public function getGlobalData() |
||
| 974 | } |
||
| 975 |
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: