Complex classes like ProductBunchProcessor 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 ProductBunchProcessor, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 32 | class ProductBunchProcessor implements ProductBunchProcessorInterface |
||
| 33 | { |
||
| 34 | |||
| 35 | /** |
||
| 36 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
| 37 | * |
||
| 38 | * @var \PDO |
||
| 39 | */ |
||
| 40 | protected $connection; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * The repository to access EAV attribute option values. |
||
| 44 | * |
||
| 45 | * @var \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository |
||
| 46 | */ |
||
| 47 | protected $eavAttributeOptionValueRepository; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * The repository to access EAV attributes. |
||
| 51 | * |
||
| 52 | * @var \TechDivision\Import\Repositories\EavAttributeRepository |
||
| 53 | */ |
||
| 54 | protected $eavAttributeRepository; |
||
| 55 | |||
| 56 | /** |
||
| 57 | * The action for product CRUD methods. |
||
| 58 | * |
||
| 59 | * @var \TechDivision\Import\Product\Actions\ProductAction |
||
| 60 | */ |
||
| 61 | protected $productAction; |
||
| 62 | |||
| 63 | /** |
||
| 64 | * The action for product varchar attribute CRUD methods. |
||
| 65 | * |
||
| 66 | * @var \TechDivision\Import\Product\Actions\ProductVarcharAction |
||
| 67 | */ |
||
| 68 | protected $productVarcharAction; |
||
| 69 | |||
| 70 | /** |
||
| 71 | * The action for product text attribute CRUD methods. |
||
| 72 | * |
||
| 73 | * @var \TechDivision\Import\Product\Actions\ProductTextAction |
||
| 74 | */ |
||
| 75 | protected $productTextAction; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * The action for product int attribute CRUD methods. |
||
| 79 | * |
||
| 80 | * @var \TechDivision\Import\Product\Actions\ProductIntAction |
||
| 81 | */ |
||
| 82 | protected $productIntAction; |
||
| 83 | |||
| 84 | /** |
||
| 85 | * The action for product decimal attribute CRUD methods. |
||
| 86 | * |
||
| 87 | * @var \TechDivision\Import\Product\Actions\ProductDecimalAction |
||
| 88 | */ |
||
| 89 | protected $productDecimalAction; |
||
| 90 | |||
| 91 | /** |
||
| 92 | * The action for product datetime attribute CRUD methods. |
||
| 93 | * |
||
| 94 | * @var \TechDivision\Import\Product\Actions\ProductDatetimeAction |
||
| 95 | */ |
||
| 96 | protected $productDatetimeAction; |
||
| 97 | |||
| 98 | /** |
||
| 99 | * The action for product website CRUD methods. |
||
| 100 | * |
||
| 101 | * @var \TechDivision\Import\Product\Actions\ProductWebsiteAction |
||
| 102 | */ |
||
| 103 | protected $productWebsiteAction; |
||
| 104 | |||
| 105 | /** |
||
| 106 | * The action for category product relation CRUD methods. |
||
| 107 | * |
||
| 108 | * @var \TechDivision\Import\Product\Actions\CategoryProductAction |
||
| 109 | */ |
||
| 110 | protected $categoryProductAction; |
||
| 111 | |||
| 112 | /** |
||
| 113 | * The action for stock item CRUD methods. |
||
| 114 | * |
||
| 115 | * @var \TechDivision\Import\Product\Actions\StockItemAction |
||
| 116 | */ |
||
| 117 | protected $stockItemAction; |
||
| 118 | |||
| 119 | /** |
||
| 120 | * The action for stock status CRUD methods. |
||
| 121 | * |
||
| 122 | * @var \TechDivision\Import\Product\Actions\StockStatusAction |
||
| 123 | */ |
||
| 124 | protected $stockStatusAction; |
||
| 125 | |||
| 126 | /** |
||
| 127 | * The action for URL rewrite CRUD methods. |
||
| 128 | * |
||
| 129 | * @var \TechDivision\Import\Product\Actions\UrlRewriteAction |
||
| 130 | */ |
||
| 131 | protected $urlRewriteAction; |
||
| 132 | |||
| 133 | /** |
||
| 134 | * The action for URL rewrite product category CRUD methods. |
||
| 135 | * |
||
| 136 | * @var \TechDivision\Import\Product\Actions\UrlRewriteProductCategoryAction |
||
| 137 | */ |
||
| 138 | protected $urlRewriteProductCategoryAction; |
||
| 139 | |||
| 140 | /** |
||
| 141 | * The repository to load the products with. |
||
| 142 | * |
||
| 143 | * @var \TechDivision\Import\Product\Repositories\ProductRepository |
||
| 144 | */ |
||
| 145 | protected $productRepository; |
||
| 146 | |||
| 147 | /** |
||
| 148 | * The repository to load the product website relations with. |
||
| 149 | * |
||
| 150 | * @var \TechDivision\Import\Product\Repositories\ProductWebsiteRepository |
||
| 151 | */ |
||
| 152 | protected $productWebsiteRepository; |
||
| 153 | |||
| 154 | /** |
||
| 155 | * The repository to load the product datetime attribute with. |
||
| 156 | * |
||
| 157 | * @var \TechDivision\Import\Product\Repositories\ProductDatetimeRepository |
||
| 158 | */ |
||
| 159 | protected $productDatetimeRepository; |
||
| 160 | |||
| 161 | /** |
||
| 162 | * The repository to load the product decimal attribute with. |
||
| 163 | * |
||
| 164 | * @var \TechDivision\Import\Product\Repositories\ProductDecimalRepository |
||
| 165 | */ |
||
| 166 | protected $productDecimalRepository; |
||
| 167 | |||
| 168 | /** |
||
| 169 | * The repository to load the product integer attribute with. |
||
| 170 | * |
||
| 171 | * @var \TechDivision\Import\Product\Repositories\ProductIntRepository |
||
| 172 | */ |
||
| 173 | protected $productIntRepository; |
||
| 174 | |||
| 175 | /** |
||
| 176 | * The repository to load the product text attribute with. |
||
| 177 | * |
||
| 178 | * @var \TechDivision\Import\Product\Repositories\ProductTextRepository |
||
| 179 | */ |
||
| 180 | protected $productTextRepository; |
||
| 181 | |||
| 182 | /** |
||
| 183 | * The repository to load the product varchar attribute with. |
||
| 184 | * |
||
| 185 | * @var \TechDivision\Import\Product\Repositories\ProductVarcharRepository |
||
| 186 | */ |
||
| 187 | protected $productVarcharRepository; |
||
| 188 | |||
| 189 | /** |
||
| 190 | * The repository to load the category product relations with. |
||
| 191 | * |
||
| 192 | * @var \TechDivision\Import\Product\Repositories\CategoryProductRepository |
||
| 193 | */ |
||
| 194 | protected $categoryProductRepository; |
||
| 195 | |||
| 196 | /** |
||
| 197 | * The repository to load the stock status with. |
||
| 198 | * |
||
| 199 | * @var \TechDivision\Import\Product\Repositories\StockStatusRepository |
||
| 200 | */ |
||
| 201 | protected $stockStatusRepository; |
||
| 202 | |||
| 203 | /** |
||
| 204 | * The repository to load the stock item with. |
||
| 205 | * |
||
| 206 | * @var \TechDivision\Import\Product\Repositories\StockItemRepository |
||
| 207 | */ |
||
| 208 | protected $stockItemRepository; |
||
| 209 | |||
| 210 | /** |
||
| 211 | * The repository to load the URL rewrites with. |
||
| 212 | * |
||
| 213 | * @var \TechDivision\Import\Product\Repositories\UrlRewriteRepository |
||
| 214 | */ |
||
| 215 | protected $urlRewriteRepository; |
||
| 216 | |||
| 217 | /** |
||
| 218 | * The repository to load the URL rewrite product category relations with. |
||
| 219 | * |
||
| 220 | * @var \TechDivision\Import\Product\Repositories\UrlRewriteProductCategoryRepository |
||
| 221 | */ |
||
| 222 | protected $urlRewriteProductCategoryRepository; |
||
| 223 | |||
| 224 | /** |
||
| 225 | * Set's the passed connection. |
||
| 226 | * |
||
| 227 | * @param \PDO $connection The connection to set |
||
| 228 | * |
||
| 229 | * @return void |
||
| 230 | */ |
||
| 231 | public function setConnection(\PDO $connection) |
||
| 235 | |||
| 236 | /** |
||
| 237 | * Return's the connection. |
||
| 238 | * |
||
| 239 | * @return \PDO The connection instance |
||
| 240 | */ |
||
| 241 | public function getConnection() |
||
| 245 | |||
| 246 | /** |
||
| 247 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
| 248 | * object instance are not committed until you end the transaction by calling ProductProcessor::commit(). |
||
| 249 | * Calling ProductProcessor::rollBack() will roll back all changes to the database and return the connection |
||
| 250 | * to autocommit mode. |
||
| 251 | * |
||
| 252 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 253 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
| 254 | */ |
||
| 255 | public function beginTransaction() |
||
| 259 | |||
| 260 | /** |
||
| 261 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
| 262 | * ProductProcessor::beginTransaction() starts a new transaction. |
||
| 263 | * |
||
| 264 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 265 | * @link http://php.net/manual/en/pdo.commit.php |
||
| 266 | */ |
||
| 267 | public function commit() |
||
| 271 | |||
| 272 | /** |
||
| 273 | * Rolls back the current transaction, as initiated by ProductProcessor::beginTransaction(). |
||
| 274 | * |
||
| 275 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
| 276 | * rolled back the transaction. |
||
| 277 | * |
||
| 278 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
| 279 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
| 280 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
| 281 | * |
||
| 282 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 283 | * @link http://php.net/manual/en/pdo.rollback.php |
||
| 284 | */ |
||
| 285 | public function rollBack() |
||
| 289 | |||
| 290 | /** |
||
| 291 | * Set's the repository to access EAV attribute option values. |
||
| 292 | * |
||
| 293 | * @param \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository $eavAttributeOptionValueRepository The repository to access EAV attribute option values |
||
| 294 | * |
||
| 295 | * @return void |
||
| 296 | */ |
||
| 297 | public function setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository) |
||
| 301 | |||
| 302 | /** |
||
| 303 | * Return's the repository to access EAV attribute option values. |
||
| 304 | * |
||
| 305 | * @return \TechDivision\Import\Product\Repositories\EavAttributeOptionValueRepository The repository instance |
||
| 306 | */ |
||
| 307 | public function getEavAttributeOptionValueRepository() |
||
| 311 | |||
| 312 | /** |
||
| 313 | * Set's the repository to access EAV attributes. |
||
| 314 | * |
||
| 315 | * @param \TechDivision\Import\Repositories\EavAttributeRepository $eavAttributeRepository The repository to access EAV attributes |
||
| 316 | * |
||
| 317 | * @return void |
||
| 318 | */ |
||
| 319 | public function setEavAttributeRepository($eavAttributeRepository) |
||
| 323 | |||
| 324 | /** |
||
| 325 | * Return's the repository to access EAV attributes. |
||
| 326 | * |
||
| 327 | * @return \TechDivision\Import\Repositories\EavAttributeRepository The repository instance |
||
| 328 | */ |
||
| 329 | public function getEavAttributeRepository() |
||
| 333 | |||
| 334 | /** |
||
| 335 | * Return's an array with the available EAV attributes for the passed is user defined flag. |
||
| 336 | * |
||
| 337 | * @param integer $isUserDefined The flag itself |
||
| 338 | * |
||
| 339 | * @return array The array with the EAV attributes matching the passed flag |
||
| 340 | */ |
||
| 341 | public function getEavAttributeByIsUserDefined($isUserDefined = 1) |
||
| 345 | |||
| 346 | /** |
||
| 347 | * Set's the action with the product CRUD methods. |
||
| 348 | * |
||
| 349 | * @param \TechDivision\Import\Product\Actions\ProductAction $productAction The action with the product CRUD methods |
||
| 350 | * |
||
| 351 | * @return void |
||
| 352 | */ |
||
| 353 | public function setProductAction($productAction) |
||
| 357 | |||
| 358 | /** |
||
| 359 | * Return's the action with the product CRUD methods. |
||
| 360 | * |
||
| 361 | * @return \TechDivision\Import\Product\Actions\ProductAction The action instance |
||
| 362 | */ |
||
| 363 | public function getProductAction() |
||
| 367 | |||
| 368 | /** |
||
| 369 | * Set's the action with the product varchar attribute CRUD methods. |
||
| 370 | * |
||
| 371 | * @param \TechDivision\Import\Product\Actions\ProductVarcharAction $productVarcharAction The action with the product varchar attriute CRUD methods |
||
| 372 | * |
||
| 373 | * @return void |
||
| 374 | */ |
||
| 375 | public function setProductVarcharAction($productVarcharAction) |
||
| 379 | |||
| 380 | /** |
||
| 381 | * Return's the action with the product varchar attribute CRUD methods. |
||
| 382 | * |
||
| 383 | * @return \TechDivision\Import\Product\Actions\ProductVarcharAction The action instance |
||
| 384 | */ |
||
| 385 | public function getProductVarcharAction() |
||
| 389 | |||
| 390 | /** |
||
| 391 | * Set's the action with the product text attribute CRUD methods. |
||
| 392 | * |
||
| 393 | * @param \TechDivision\Import\Product\Actions\ProductTextAction $productTextAction The action with the product text attriute CRUD methods |
||
| 394 | * |
||
| 395 | * @return void |
||
| 396 | */ |
||
| 397 | public function setProductTextAction($productTextAction) |
||
| 401 | |||
| 402 | /** |
||
| 403 | * Return's the action with the product text attribute CRUD methods. |
||
| 404 | * |
||
| 405 | * @return \TechDivision\Import\Product\Actions\ProductTextAction The action instance |
||
| 406 | */ |
||
| 407 | public function getProductTextAction() |
||
| 411 | |||
| 412 | /** |
||
| 413 | * Set's the action with the product int attribute CRUD methods. |
||
| 414 | * |
||
| 415 | * @param \TechDivision\Import\Product\Actions\ProductIntAction $productIntAction The action with the product int attriute CRUD methods |
||
| 416 | * |
||
| 417 | * @return void |
||
| 418 | */ |
||
| 419 | public function setProductIntAction($productIntAction) |
||
| 423 | |||
| 424 | /** |
||
| 425 | * Return's the action with the product int attribute CRUD methods. |
||
| 426 | * |
||
| 427 | * @return \TechDivision\Import\Product\Actions\ProductIntAction The action instance |
||
| 428 | */ |
||
| 429 | public function getProductIntAction() |
||
| 433 | |||
| 434 | /** |
||
| 435 | * Set's the action with the product decimal attribute CRUD methods. |
||
| 436 | * |
||
| 437 | * @param \TechDivision\Import\Product\Actions\ProductDecimalAction $productDecimalAction The action with the product decimal attriute CRUD methods |
||
| 438 | * |
||
| 439 | * @return void |
||
| 440 | */ |
||
| 441 | public function setProductDecimalAction($productDecimalAction) |
||
| 445 | |||
| 446 | /** |
||
| 447 | * Return's the action with the product decimal attribute CRUD methods. |
||
| 448 | * |
||
| 449 | * @return \TechDivision\Import\Product\Actions\ProductDecimalAction The action instance |
||
| 450 | */ |
||
| 451 | public function getProductDecimalAction() |
||
| 455 | |||
| 456 | /** |
||
| 457 | * Set's the action with the product datetime attribute CRUD methods. |
||
| 458 | * |
||
| 459 | * @param \TechDivision\Import\Product\Actions\ProductDatetimeAction $productDatetimeAction The action with the product datetime attriute CRUD methods |
||
| 460 | * |
||
| 461 | * @return void |
||
| 462 | */ |
||
| 463 | public function setProductDatetimeAction($productDatetimeAction) |
||
| 467 | |||
| 468 | /** |
||
| 469 | * Return's the action with the product datetime attribute CRUD methods. |
||
| 470 | * |
||
| 471 | * @return \TechDivision\Import\Product\Actions\ProductDatetimeAction The action instance |
||
| 472 | */ |
||
| 473 | public function getProductDatetimeAction() |
||
| 477 | |||
| 478 | /** |
||
| 479 | * Set's the action with the product website CRUD methods. |
||
| 480 | * |
||
| 481 | * @param \TechDivision\Import\Product\Actions\ProductWebsiteAction $productWebsiteAction The action with the product website CRUD methods |
||
| 482 | * |
||
| 483 | * @return void |
||
| 484 | */ |
||
| 485 | public function setProductWebsiteAction($productWebsiteAction) |
||
| 489 | |||
| 490 | /** |
||
| 491 | * Return's the action with the product website CRUD methods. |
||
| 492 | * |
||
| 493 | * @return \TechDivision\Import\Product\Actions\ProductWebsiteAction The action instance |
||
| 494 | */ |
||
| 495 | public function getProductWebsiteAction() |
||
| 499 | |||
| 500 | /** |
||
| 501 | * Set's the action with the category product relation CRUD methods. |
||
| 502 | * |
||
| 503 | * @param \TechDivision\Import\Product\Actions\ProductCategoryAction $categoryProductAction The action with the category product relation CRUD methods |
||
| 504 | * |
||
| 505 | * @return void |
||
| 506 | */ |
||
| 507 | public function setCategoryProductAction($categoryProductAction) |
||
| 511 | |||
| 512 | /** |
||
| 513 | * Return's the action with the category product relation CRUD methods. |
||
| 514 | * |
||
| 515 | * @return \TechDivision\Import\Product\Actions\CategoryProductAction The action instance |
||
| 516 | */ |
||
| 517 | public function getCategoryProductAction() |
||
| 521 | |||
| 522 | /** |
||
| 523 | * Set's the action with the stock item CRUD methods. |
||
| 524 | * |
||
| 525 | * @param \TechDivision\Import\Product\Actions\StockItemAction $stockItemAction The action with the stock item CRUD methods |
||
| 526 | * |
||
| 527 | * @return void |
||
| 528 | */ |
||
| 529 | public function setStockItemAction($stockItemAction) |
||
| 533 | |||
| 534 | /** |
||
| 535 | * Return's the action with the stock item CRUD methods. |
||
| 536 | * |
||
| 537 | * @return \TechDivision\Import\Product\Actions\StockItemAction The action instance |
||
| 538 | */ |
||
| 539 | public function getStockItemAction() |
||
| 543 | |||
| 544 | /** |
||
| 545 | * Set's the action with the stock status CRUD methods. |
||
| 546 | * |
||
| 547 | * @param \TechDivision\Import\Product\Actions\StockStatusAction $stockStatusAction The action with the stock status CRUD methods |
||
| 548 | * |
||
| 549 | * @return void |
||
| 550 | */ |
||
| 551 | public function setStockStatusAction($stockStatusAction) |
||
| 555 | |||
| 556 | /** |
||
| 557 | * Return's the action with the stock status CRUD methods. |
||
| 558 | * |
||
| 559 | * @return \TechDivision\Import\Product\Actions\StockStatusAction The action instance |
||
| 560 | */ |
||
| 561 | public function getStockStatusAction() |
||
| 565 | |||
| 566 | /** |
||
| 567 | * Set's the action with the URL rewrite CRUD methods. |
||
| 568 | * |
||
| 569 | * @param \TechDivision\Import\Product\Actions\UrlRewriteAction $urlRewriteAction The action with the URL rewrite CRUD methods |
||
| 570 | * |
||
| 571 | * @return void |
||
| 572 | */ |
||
| 573 | public function setUrlRewriteAction($urlRewriteAction) |
||
| 577 | |||
| 578 | /** |
||
| 579 | * Return's the action with the URL rewrite CRUD methods. |
||
| 580 | * |
||
| 581 | * @return \TechDivision\Import\Product\Actions\UrlRewriteAction The action instance |
||
| 582 | */ |
||
| 583 | public function getUrlRewriteAction() |
||
| 587 | |||
| 588 | /** |
||
| 589 | * Set's the action with the URL rewrite product category CRUD methods. |
||
| 590 | * |
||
| 591 | * @param \TechDivision\Import\Product\Actions\UrlRewriteAction $urlRewriteProductCategoryAction The action with the URL rewrite CRUD methods |
||
| 592 | * |
||
| 593 | * @return void |
||
| 594 | */ |
||
| 595 | public function setUrlRewriteProductCategoryAction($urlRewriteProductCategoryAction) |
||
| 599 | |||
| 600 | /** |
||
| 601 | * Return's the action with the URL rewrite product category CRUD methods. |
||
| 602 | * |
||
| 603 | * @return \TechDivision\Import\Product\Actions\UrlRewriteProductCategoryAction The action instance |
||
| 604 | */ |
||
| 605 | public function getUrlRewriteProductCategoryAction() |
||
| 609 | |||
| 610 | /** |
||
| 611 | * Set's the repository to load the products with. |
||
| 612 | * |
||
| 613 | * @param \TechDivision\Import\Product\Repositories\ProductRepository $productRepository The repository instance |
||
| 614 | * |
||
| 615 | * @return void |
||
| 616 | */ |
||
| 617 | public function setProductRepository($productRepository) |
||
| 621 | |||
| 622 | /** |
||
| 623 | * Return's the repository to load the products with. |
||
| 624 | * |
||
| 625 | * @return \TechDivision\Import\Product\Repositories\ProductRepository The repository instance |
||
| 626 | */ |
||
| 627 | public function getProductRepository() |
||
| 631 | |||
| 632 | /** |
||
| 633 | * Set's the repository to load the product website relations with. |
||
| 634 | * |
||
| 635 | * @param \TechDivision\Import\Product\Repositories\ProductWebsiteRepository $productWebsiteRepository The repository instance |
||
| 636 | * |
||
| 637 | * @return void |
||
| 638 | */ |
||
| 639 | public function setProductWebsiteRepository($productWebsiteRepository) |
||
| 643 | |||
| 644 | /** |
||
| 645 | * Return's the repository to load the product website relations with. |
||
| 646 | * |
||
| 647 | * @return \TechDivision\Import\Product\Repositories\ProductWebsiteRepository The repository instance |
||
| 648 | */ |
||
| 649 | public function getProductWebsiteRepository() |
||
| 653 | |||
| 654 | /** |
||
| 655 | * Set's the repository to load the product datetime attribute with. |
||
| 656 | * |
||
| 657 | * @param \TechDivision\Import\Product\Repositories\ProductDatetimeRepository $productDatetimeRepository The repository instance |
||
| 658 | * |
||
| 659 | * @return void |
||
| 660 | */ |
||
| 661 | public function setProductDatetimeRepository($productDatetimeRepository) |
||
| 665 | |||
| 666 | /** |
||
| 667 | * Return's the repository to load the product datetime attribute with. |
||
| 668 | * |
||
| 669 | * @return \TechDivision\Import\Product\Repositories\ProductDatetimeRepository The repository instance |
||
| 670 | */ |
||
| 671 | public function getProductDatetimeRepository() |
||
| 675 | |||
| 676 | /** |
||
| 677 | * Set's the repository to load the product decimal attribute with. |
||
| 678 | * |
||
| 679 | * @param \TechDivision\Import\Product\Repositories\ProductDecimalRepository $productDecimalRepository The repository instance |
||
| 680 | * |
||
| 681 | * @return void |
||
| 682 | */ |
||
| 683 | public function setProductDecimalRepository($productDecimalRepository) |
||
| 687 | |||
| 688 | /** |
||
| 689 | * Return's the repository to load the product decimal attribute with. |
||
| 690 | * |
||
| 691 | * @return \TechDivision\Import\Product\Repositories\ProductDecimalRepository The repository instance |
||
| 692 | */ |
||
| 693 | public function getProductDecimalRepository() |
||
| 697 | |||
| 698 | /** |
||
| 699 | * Set's the repository to load the product integer attribute with. |
||
| 700 | * |
||
| 701 | * @param \TechDivision\Import\Product\Repositories\ProductIntRepository $productIntRepository The repository instance |
||
| 702 | * |
||
| 703 | * @return void |
||
| 704 | */ |
||
| 705 | public function setProductIntRepository($productIntRepository) |
||
| 709 | |||
| 710 | /** |
||
| 711 | * Return's the repository to load the product integer attribute with. |
||
| 712 | * |
||
| 713 | * @return \TechDivision\Import\Product\Repositories\ProductIntRepository The repository instance |
||
| 714 | */ |
||
| 715 | public function getProductIntRepository() |
||
| 719 | |||
| 720 | /** |
||
| 721 | * Set's the repository to load the product text attribute with. |
||
| 722 | * |
||
| 723 | * @param \TechDivision\Import\Product\Repositories\ProductTextRepository $productTextRepository The repository instance |
||
| 724 | * |
||
| 725 | * @return void |
||
| 726 | */ |
||
| 727 | public function setProductTextRepository($productTextRepository) |
||
| 731 | |||
| 732 | /** |
||
| 733 | * Return's the repository to load the product text attribute with. |
||
| 734 | * |
||
| 735 | * @return \TechDivision\Import\Product\Repositories\ProductTextRepository The repository instance |
||
| 736 | */ |
||
| 737 | public function getProductTextRepository() |
||
| 741 | |||
| 742 | /** |
||
| 743 | * Set's the repository to load the product varchar attribute with. |
||
| 744 | * |
||
| 745 | * @param \TechDivision\Import\Product\Repositories\ProductVarcharRepository $productVarcharRepository The repository instance |
||
| 746 | * |
||
| 747 | * @return void |
||
| 748 | */ |
||
| 749 | public function setProductVarcharRepository($productVarcharRepository) |
||
| 753 | |||
| 754 | /** |
||
| 755 | * Return's the repository to load the product varchar attribute with. |
||
| 756 | * |
||
| 757 | * @return \TechDivision\Import\Product\Repositories\ProductVarcharRepository The repository instance |
||
| 758 | */ |
||
| 759 | public function getProductVarcharRepository() |
||
| 763 | |||
| 764 | /** |
||
| 765 | * Set's the repository to load the category product relations with. |
||
| 766 | * |
||
| 767 | * @param \TechDivision\Import\Product\Repositories\CategoryProductRepository $categoryProductRepository The repository instance |
||
| 768 | * |
||
| 769 | * @return void |
||
| 770 | */ |
||
| 771 | public function setCategoryProductRepository($categoryProductRepository) |
||
| 775 | |||
| 776 | /** |
||
| 777 | * Return's the repository to load the category product relations with. |
||
| 778 | * |
||
| 779 | * @return \TechDivision\Import\Product\Repositories\CategoryProductRepository The repository instance |
||
| 780 | */ |
||
| 781 | public function getCategoryProductRepository() |
||
| 785 | |||
| 786 | /** |
||
| 787 | * Set's the repository to load the stock status with. |
||
| 788 | * |
||
| 789 | * @param \TechDivision\Import\Product\Repositories\StockStatusRepository $stockStatusRepository The repository instance |
||
| 790 | * |
||
| 791 | * @return void |
||
| 792 | */ |
||
| 793 | public function setStockStatusRepository($stockStatusRepository) |
||
| 797 | |||
| 798 | /** |
||
| 799 | * Return's the repository to load the stock status with. |
||
| 800 | * |
||
| 801 | * @return \TechDivision\Import\Product\Repositories\StockStatusRepository The repository instance |
||
| 802 | */ |
||
| 803 | public function getStockStatusRepository() |
||
| 807 | |||
| 808 | /** |
||
| 809 | * Set's the repository to load the stock items with. |
||
| 810 | * |
||
| 811 | * @param \TechDivision\Import\Product\Repositories\StockItemRepository $stockItemRepository The repository instance |
||
| 812 | * |
||
| 813 | * @return void |
||
| 814 | */ |
||
| 815 | public function setStockItemRepository($stockItemRepository) |
||
| 819 | |||
| 820 | /** |
||
| 821 | * Return's the repository to load the stock items with. |
||
| 822 | * |
||
| 823 | * @return \TechDivision\Import\Product\Repositories\StockItemRepository The repository instance |
||
| 824 | */ |
||
| 825 | public function getStockItemRepository() |
||
| 829 | |||
| 830 | /** |
||
| 831 | * Set's the repository to load the URL rewrites with. |
||
| 832 | * |
||
| 833 | * @param \TechDivision\Import\Product\Repositories\UrlRewriteRepository $urlRewriteRepository The repository instance |
||
| 834 | * |
||
| 835 | * @return void |
||
| 836 | */ |
||
| 837 | public function setUrlRewriteRepository($urlRewriteRepository) |
||
| 841 | |||
| 842 | /** |
||
| 843 | * Return's the repository to load the URL rewrites with. |
||
| 844 | * |
||
| 845 | * @return \TechDivision\Import\Product\Repositories\UrlRewriteRepository The repository instance |
||
| 846 | */ |
||
| 847 | public function getUrlRewriteRepository() |
||
| 851 | |||
| 852 | /** |
||
| 853 | * Set's the repository to load the URL rewrite product category relations with. |
||
| 854 | * |
||
| 855 | * @param \TechDivision\Import\Product\Repositories\UrlRewriteProductCategoryRepository $urlRewriteProductCategoryRepository The repository instance |
||
| 856 | * |
||
| 857 | * @return void |
||
| 858 | */ |
||
| 859 | public function setUrlRewriteProductCategoryRepository($urlRewriteProductCategoryRepository) |
||
| 863 | |||
| 864 | /** |
||
| 865 | * Return's the repository to load the URL rewrite product category relations with. |
||
| 866 | * |
||
| 867 | * @return \TechDivision\Import\Product\Repositories\UrlRewriteProductCategoryRepository The repository instance |
||
| 868 | */ |
||
| 869 | public function getUrlRewriteProductCategoryRepository() |
||
| 873 | |||
| 874 | /** |
||
| 875 | * Return's the attribute option value with the passed value and store ID. |
||
| 876 | * |
||
| 877 | * @param mixed $value The option value |
||
| 878 | * @param integer $storeId The ID of the store |
||
| 879 | * |
||
| 880 | * @return array|boolean The attribute option value instance |
||
| 881 | */ |
||
| 882 | public function getEavAttributeOptionValueByOptionValueAndStoreId($value, $storeId) |
||
| 886 | |||
| 887 | /** |
||
| 888 | * Return's the URL rewrites for the passed URL entity type and ID. |
||
| 889 | * |
||
| 890 | * @param string $entityType The entity type to load the URL rewrites for |
||
| 891 | * @param integer $entityId The entity ID to laod the rewrites for |
||
| 892 | * |
||
| 893 | * @return array The URL rewrites |
||
| 894 | */ |
||
| 895 | public function getUrlRewritesByEntityTypeAndEntityId($entityType, $entityId) |
||
| 899 | |||
| 900 | /** |
||
| 901 | * Load's and return's the product with the passed SKU. |
||
| 902 | * |
||
| 903 | * @param string $sku The SKU of the product to load |
||
| 904 | * |
||
| 905 | * @return array The product |
||
| 906 | */ |
||
| 907 | public function loadProduct($sku) |
||
| 911 | |||
| 912 | /** |
||
| 913 | * Load's and return's the product website relation with the passed product and website ID. |
||
| 914 | * |
||
| 915 | * @param string $productId The product ID of the relation |
||
| 916 | * @param string $websiteId The website ID of the relation |
||
| 917 | * |
||
| 918 | * @return array The product website |
||
| 919 | */ |
||
| 920 | public function loadProductWebsite($productId, $websiteId) |
||
| 924 | |||
| 925 | /** |
||
| 926 | * Return's the category product relation with the passed category/product ID. |
||
| 927 | * |
||
| 928 | * @param integer $categoryId The category ID of the category product relation to return |
||
| 929 | * @param integer $productId The product ID of the category product relation to return |
||
| 930 | * |
||
| 931 | * @return array The category product relation |
||
| 932 | */ |
||
| 933 | public function loadCategoryProduct($categoryId, $productId) |
||
| 937 | |||
| 938 | /** |
||
| 939 | * Load's and return's the stock status with the passed product/website/stock ID. |
||
| 940 | * |
||
| 941 | * @param integer $productId The product ID of the stock status to load |
||
| 942 | * @param integer $websiteId The website ID of the stock status to load |
||
| 943 | * @param integer $stockId The stock ID of the stock status to load |
||
| 944 | * |
||
| 945 | * @return array The stock status |
||
| 946 | */ |
||
| 947 | public function loadStockStatus($productId, $websiteId, $stockId) |
||
| 951 | |||
| 952 | /** |
||
| 953 | * Load's and return's the stock status with the passed product/website/stock ID. |
||
| 954 | * |
||
| 955 | * @param integer $productId The product ID of the stock item to load |
||
| 956 | * @param integer $websiteId The website ID of the stock item to load |
||
| 957 | * @param integer $stockId The stock ID of the stock item to load |
||
| 958 | * |
||
| 959 | * @return array The stock item |
||
| 960 | */ |
||
| 961 | public function loadStockItem($productId, $websiteId, $stockId) |
||
| 965 | |||
| 966 | /** |
||
| 967 | * Load's and return's the datetime attribute with the passed entity/attribute/store ID. |
||
| 968 | * |
||
| 969 | * @param integer $entityId The entity ID of the attribute |
||
| 970 | * @param integer $attributeId The attribute ID of the attribute |
||
| 971 | * @param integer $storeId The store ID of the attribute |
||
| 972 | * |
||
| 973 | * @return array|null The datetime attribute |
||
| 974 | */ |
||
| 975 | public function loadProductDatetimeAttribute($entityId, $attributeId, $storeId) |
||
| 979 | |||
| 980 | /** |
||
| 981 | * Load's and return's the decimal attribute with the passed entity/attribute/store ID. |
||
| 982 | * |
||
| 983 | * @param integer $entityId The entity ID of the attribute |
||
| 984 | * @param integer $attributeId The attribute ID of the attribute |
||
| 985 | * @param integer $storeId The store ID of the attribute |
||
| 986 | * |
||
| 987 | * @return array|null The decimal attribute |
||
| 988 | */ |
||
| 989 | public function loadProductDecimalAttribute($entityId, $attributeId, $storeId) |
||
| 993 | |||
| 994 | /** |
||
| 995 | * Load's and return's the integer attribute with the passed entity/attribute/store ID. |
||
| 996 | * |
||
| 997 | * @param integer $entityId The entity ID of the attribute |
||
| 998 | * @param integer $attributeId The attribute ID of the attribute |
||
| 999 | * @param integer $storeId The store ID of the attribute |
||
| 1000 | * |
||
| 1001 | * @return array|null The integer attribute |
||
| 1002 | */ |
||
| 1003 | public function loadProductIntAttribute($entityId, $attributeId, $storeId) |
||
| 1007 | |||
| 1008 | /** |
||
| 1009 | * Load's and return's the text attribute with the passed entity/attribute/store ID. |
||
| 1010 | * |
||
| 1011 | * @param integer $entityId The entity ID of the attribute |
||
| 1012 | * @param integer $attributeId The attribute ID of the attribute |
||
| 1013 | * @param integer $storeId The store ID of the attribute |
||
| 1014 | * |
||
| 1015 | * @return array|null The text attribute |
||
| 1016 | */ |
||
| 1017 | public function loadProductTextAttribute($entityId, $attributeId, $storeId) |
||
| 1021 | |||
| 1022 | /** |
||
| 1023 | * Load's and return's the varchar attribute with the passed entity/attribute/store ID. |
||
| 1024 | * |
||
| 1025 | * @param integer $entityId The entity ID of the attribute |
||
| 1026 | * @param integer $attributeId The attribute ID of the attribute |
||
| 1027 | * @param integer $storeId The store ID of the attribute |
||
| 1028 | * |
||
| 1029 | * @return array|null The varchar attribute |
||
| 1030 | */ |
||
| 1031 | public function loadProductVarcharAttribute($entityId, $attributeId, $storeId) |
||
| 1035 | |||
| 1036 | /** |
||
| 1037 | * Return's the URL rewrite product category relation for the passed |
||
| 1038 | * product and category ID. |
||
| 1039 | * |
||
| 1040 | * @param integer $productId The product ID to load the URL rewrite product category relation for |
||
| 1041 | * @param integer $categoryId The category ID to load the URL rewrite product category relation for |
||
| 1042 | * |
||
| 1043 | * @return array|false The URL rewrite product category relations |
||
| 1044 | */ |
||
| 1045 | public function loadUrlRewriteProductCategory($productId, $categoryId) |
||
| 1049 | |||
| 1050 | /** |
||
| 1051 | * Persist's the passed product data and return's the ID. |
||
| 1052 | * |
||
| 1053 | * @param array $product The product data to persist |
||
| 1054 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1055 | * |
||
| 1056 | * @return string The ID of the persisted entity |
||
| 1057 | */ |
||
| 1058 | public function persistProduct($product, $name = null) |
||
| 1062 | |||
| 1063 | /** |
||
| 1064 | * Persist's the passed product varchar attribute. |
||
| 1065 | * |
||
| 1066 | * @param array $attribute The attribute to persist |
||
| 1067 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1068 | * |
||
| 1069 | * @return void |
||
| 1070 | */ |
||
| 1071 | public function persistProductVarcharAttribute($attribute, $name = null) |
||
| 1075 | |||
| 1076 | /** |
||
| 1077 | * Persist's the passed product integer attribute. |
||
| 1078 | * |
||
| 1079 | * @param array $attribute The attribute to persist |
||
| 1080 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1081 | * |
||
| 1082 | * @return void |
||
| 1083 | */ |
||
| 1084 | public function persistProductIntAttribute($attribute, $name = null) |
||
| 1088 | |||
| 1089 | /** |
||
| 1090 | * Persist's the passed product decimal attribute. |
||
| 1091 | * |
||
| 1092 | * @param array $attribute The attribute to persist |
||
| 1093 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1094 | * |
||
| 1095 | * @return void |
||
| 1096 | */ |
||
| 1097 | public function persistProductDecimalAttribute($attribute, $name = null) |
||
| 1101 | |||
| 1102 | /** |
||
| 1103 | * Persist's the passed product datetime attribute. |
||
| 1104 | * |
||
| 1105 | * @param array $attribute The attribute to persist |
||
| 1106 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1107 | * |
||
| 1108 | * @return void |
||
| 1109 | */ |
||
| 1110 | public function persistProductDatetimeAttribute($attribute, $name = null) |
||
| 1114 | |||
| 1115 | /** |
||
| 1116 | * Persist's the passed product text attribute. |
||
| 1117 | * |
||
| 1118 | * @param array $attribute The attribute to persist |
||
| 1119 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1120 | * |
||
| 1121 | * @return void |
||
| 1122 | */ |
||
| 1123 | public function persistProductTextAttribute($attribute, $name = null) |
||
| 1127 | |||
| 1128 | /** |
||
| 1129 | * Persist's the passed product website data and return's the ID. |
||
| 1130 | * |
||
| 1131 | * @param array $productWebsite The product website data to persist |
||
| 1132 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1133 | * |
||
| 1134 | * @return void |
||
| 1135 | */ |
||
| 1136 | public function persistProductWebsite($productWebsite, $name = null) |
||
| 1140 | |||
| 1141 | /** |
||
| 1142 | * Persist's the passed category product relation. |
||
| 1143 | * |
||
| 1144 | * @param array $categoryProduct The category product relation to persist |
||
| 1145 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1146 | * |
||
| 1147 | * @return void |
||
| 1148 | */ |
||
| 1149 | public function persistCategoryProduct($categoryProduct, $name = null) |
||
| 1153 | |||
| 1154 | /** |
||
| 1155 | * Persist's the passed stock item data and return's the ID. |
||
| 1156 | * |
||
| 1157 | * @param array $stockItem The stock item data to persist |
||
| 1158 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1159 | * |
||
| 1160 | * @return void |
||
| 1161 | */ |
||
| 1162 | public function persistStockItem($stockItem, $name = null) |
||
| 1166 | |||
| 1167 | /** |
||
| 1168 | * Persist's the passed stock status data and return's the ID. |
||
| 1169 | * |
||
| 1170 | * @param array $stockStatus The stock status data to persist |
||
| 1171 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1172 | * |
||
| 1173 | * @return void |
||
| 1174 | */ |
||
| 1175 | public function persistStockStatus($stockStatus, $name = null) |
||
| 1179 | |||
| 1180 | /** |
||
| 1181 | * Persist's the URL write with the passed data. |
||
| 1182 | * |
||
| 1183 | * @param array $row The URL rewrite to persist |
||
| 1184 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1185 | * |
||
| 1186 | * @return string The ID of the persisted entity |
||
| 1187 | */ |
||
| 1188 | public function persistUrlRewrite($row, $name = null) |
||
| 1192 | |||
| 1193 | /** |
||
| 1194 | * Persist's the URL rewrite product => category relation with the passed data. |
||
| 1195 | * |
||
| 1196 | * @param array $row The URL rewrite product => category relation to persist |
||
| 1197 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1198 | * |
||
| 1199 | * @return void |
||
| 1200 | */ |
||
| 1201 | public function persistUrlRewriteProductCategory($row, $name = null) |
||
| 1205 | |||
| 1206 | /** |
||
| 1207 | * Delete's the entity with the passed attributes. |
||
| 1208 | * |
||
| 1209 | * @param array $row The attributes of the entity to delete |
||
| 1210 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1211 | * |
||
| 1212 | * @return void |
||
| 1213 | */ |
||
| 1214 | public function deleteProduct($row, $name = null) |
||
| 1218 | |||
| 1219 | /** |
||
| 1220 | * Delete's the URL rewrite with the passed attributes. |
||
| 1221 | * |
||
| 1222 | * @param array $row The attributes of the entity to delete |
||
| 1223 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1224 | * |
||
| 1225 | * @return void |
||
| 1226 | */ |
||
| 1227 | public function deleteUrlRewrite($row, $name = null) |
||
| 1231 | |||
| 1232 | /** |
||
| 1233 | * Delete's the stock item(s) with the passed attributes. |
||
| 1234 | * |
||
| 1235 | * @param array $row The attributes of the entity to delete |
||
| 1236 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1237 | * |
||
| 1238 | * @return void |
||
| 1239 | */ |
||
| 1240 | public function deleteStockItem($row, $name = null) |
||
| 1244 | |||
| 1245 | /** |
||
| 1246 | * Delete's the stock status with the passed attributes. |
||
| 1247 | * |
||
| 1248 | * @param array $row The attributes of the entity to delete |
||
| 1249 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1250 | * |
||
| 1251 | * @return void |
||
| 1252 | */ |
||
| 1253 | public function deleteStockStatus($row, $name = null) |
||
| 1257 | |||
| 1258 | /** |
||
| 1259 | * Delete's the product website relations with the passed attributes. |
||
| 1260 | * |
||
| 1261 | * @param array $row The attributes of the entity to delete |
||
| 1262 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1263 | * |
||
| 1264 | * @return void |
||
| 1265 | */ |
||
| 1266 | public function deleteProductWebsite($row, $name = null) |
||
| 1270 | |||
| 1271 | /** |
||
| 1272 | * Delete's the category product relations with the passed attributes. |
||
| 1273 | * |
||
| 1274 | * @param array $row The attributes of the entity to delete |
||
| 1275 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 1276 | * |
||
| 1277 | * @return void |
||
| 1278 | */ |
||
| 1279 | public function deleteCategoryProduct($row, $name = null) |
||
| 1283 | } |
||
| 1284 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.