Complex classes like Configuration 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 Configuration, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 52 | class Configuration implements ConfigurationInterface, ListenerAwareConfigurationInterface |
||
|
|
|||
| 53 | { |
||
| 54 | |||
| 55 | /** |
||
| 56 | * The default PID filename to use. |
||
| 57 | * |
||
| 58 | * @var string |
||
| 59 | */ |
||
| 60 | const PID_FILENAME = 'importer.pid'; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Trait that provides CSV configuration functionality. |
||
| 64 | * |
||
| 65 | * @var \TechDivision\Import\Configuration\Jms\Configuration\CsvTrait |
||
| 66 | */ |
||
| 67 | use CsvTrait; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Trait that provides CSV configuration functionality. |
||
| 71 | * |
||
| 72 | * @var \TechDivision\Import\Configuration\Jms\Configuration\ParamsTrait |
||
| 73 | */ |
||
| 74 | use ParamsTrait; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Trait that provides CSV configuration functionality. |
||
| 78 | * |
||
| 79 | * @var \TechDivision\Import\Configuration\Jms\Configuration\ListenersTrait |
||
| 80 | */ |
||
| 81 | use ListenersTrait; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * The array with the available database types. |
||
| 85 | * |
||
| 86 | * @var array |
||
| 87 | * @Exclude |
||
| 88 | */ |
||
| 89 | protected $availableDatabaseTypes = array( |
||
| 90 | DatabaseConfigurationInterface::TYPE_MYSQL, |
||
| 91 | DatabaseConfigurationInterface::TYPE_REDIS |
||
| 92 | ); |
||
| 93 | |||
| 94 | /** |
||
| 95 | * Mapping for boolean values passed on the console. |
||
| 96 | * |
||
| 97 | * @var array |
||
| 98 | * @Exclude |
||
| 99 | */ |
||
| 100 | protected $booleanMapping = array( |
||
| 101 | 'true' => true, |
||
| 102 | 'false' => false, |
||
| 103 | '1' => true, |
||
| 104 | '0' => false, |
||
| 105 | 'on' => true, |
||
| 106 | 'off' => false |
||
| 107 | ); |
||
| 108 | |||
| 109 | /** |
||
| 110 | * Mapping for entity type to edition mapping (for configuration purposes only). |
||
| 111 | * |
||
| 112 | * @var array |
||
| 113 | * @Exclude |
||
| 114 | */ |
||
| 115 | protected $entityTypeToEditionMapping = array(/* |
||
| 116 | 'eav_attribute' => 'general', |
||
| 117 | 'eav_attribte_set' => 'general', |
||
| 118 | 'catalog_product_inventory_msi' => 'general', |
||
| 119 | 'catalog_product_tier_price' => 'general', |
||
| 120 | 'customer_address' => 'general', |
||
| 121 | 'customer' => 'general' |
||
| 122 | */); |
||
| 123 | |||
| 124 | /** |
||
| 125 | * The serial that will be passed as commandline option (can not be specified in configuration file). |
||
| 126 | * |
||
| 127 | * @var string |
||
| 128 | * @Exclude |
||
| 129 | */ |
||
| 130 | protected $serial; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * The application's unique DI identifier. |
||
| 134 | * |
||
| 135 | * @var string |
||
| 136 | * @Type("string") |
||
| 137 | * @SerializedName("id") |
||
| 138 | */ |
||
| 139 | protected $id; |
||
| 140 | |||
| 141 | /** |
||
| 142 | * The system name to use. |
||
| 143 | * |
||
| 144 | * @var string |
||
| 145 | * @Type("string") |
||
| 146 | * @SerializedName("system-name") |
||
| 147 | */ |
||
| 148 | protected $systemName; |
||
| 149 | |||
| 150 | /** |
||
| 151 | * The operation names to be executed. |
||
| 152 | * |
||
| 153 | * @var array |
||
| 154 | * @Type("array<string>") |
||
| 155 | * @SerializedName("operation-names") |
||
| 156 | */ |
||
| 157 | protected $operationNames = array(); |
||
| 158 | |||
| 159 | /** |
||
| 160 | * The entity type code to use. |
||
| 161 | * |
||
| 162 | * @var string |
||
| 163 | * @Type("string") |
||
| 164 | * @SerializedName("entity-type-code") |
||
| 165 | */ |
||
| 166 | protected $entityTypeCode; |
||
| 167 | |||
| 168 | /** |
||
| 169 | * The Magento installation directory. |
||
| 170 | * |
||
| 171 | * @var string |
||
| 172 | * @Type("string") |
||
| 173 | * @SerializedName("installation-dir") |
||
| 174 | */ |
||
| 175 | protected $installationDir; |
||
| 176 | |||
| 177 | /** |
||
| 178 | * The source directory that has to be watched for new files. |
||
| 179 | * |
||
| 180 | * @var string |
||
| 181 | * @Type("string") |
||
| 182 | * @SerializedName("source-dir") |
||
| 183 | */ |
||
| 184 | protected $sourceDir; |
||
| 185 | |||
| 186 | /** |
||
| 187 | * The target directory with the files that has been imported. |
||
| 188 | * |
||
| 189 | * @var string |
||
| 190 | * @Type("string") |
||
| 191 | * @SerializedName("target-dir") |
||
| 192 | */ |
||
| 193 | protected $targetDir; |
||
| 194 | |||
| 195 | /** |
||
| 196 | * The Magento edition, EE or CE. |
||
| 197 | * |
||
| 198 | * @var string |
||
| 199 | * @Type("string") |
||
| 200 | * @SerializedName("magento-edition") |
||
| 201 | */ |
||
| 202 | protected $magentoEdition = 'CE'; |
||
| 203 | |||
| 204 | /** |
||
| 205 | * The Magento version, e. g. 2.2.0. |
||
| 206 | * |
||
| 207 | * @var string |
||
| 208 | * @Type("string") |
||
| 209 | * @SerializedName("magento-version") |
||
| 210 | */ |
||
| 211 | protected $magentoVersion = '2.2.0'; |
||
| 212 | |||
| 213 | /** |
||
| 214 | * ArrayCollection with the information of the configured databases. |
||
| 215 | * |
||
| 216 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 217 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Database>") |
||
| 218 | */ |
||
| 219 | protected $databases; |
||
| 220 | |||
| 221 | /** |
||
| 222 | * ArrayCollection with the information of the configured loggers. |
||
| 223 | * |
||
| 224 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 225 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Logger>") |
||
| 226 | */ |
||
| 227 | protected $loggers; |
||
| 228 | |||
| 229 | /** |
||
| 230 | * ArrayCollection with the information of the configured operations. |
||
| 231 | * |
||
| 232 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 233 | * @Type("array<string, array<string, ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Operation>>>") |
||
| 234 | */ |
||
| 235 | protected $operations; |
||
| 236 | |||
| 237 | /** |
||
| 238 | * The subject's multiple field delimiter character for fields with multiple values, defaults to (,). |
||
| 239 | * |
||
| 240 | * @var string |
||
| 241 | * @Type("string") |
||
| 242 | * @SerializedName("multiple-field-delimiter") |
||
| 243 | */ |
||
| 244 | protected $multipleFieldDelimiter = ','; |
||
| 245 | |||
| 246 | /** |
||
| 247 | * The subject's multiple value delimiter character for fields with multiple values, defaults to (|). |
||
| 248 | * |
||
| 249 | * @var string |
||
| 250 | * @Type("string") |
||
| 251 | * @SerializedName("multiple-value-delimiter") |
||
| 252 | */ |
||
| 253 | protected $multipleValueDelimiter = '|'; |
||
| 254 | |||
| 255 | /** |
||
| 256 | * The flag to signal that the subject has to use the strict mode or not. |
||
| 257 | * |
||
| 258 | * @var boolean |
||
| 259 | * @Type("boolean") |
||
| 260 | * @SerializedName("strict-mode") |
||
| 261 | */ |
||
| 262 | protected $strictMode; |
||
| 263 | |||
| 264 | /** |
||
| 265 | * The flag whether or not the import artefacts have to be archived. |
||
| 266 | * |
||
| 267 | * @var boolean |
||
| 268 | * @Type("boolean") |
||
| 269 | * @SerializedName("archive-artefacts") |
||
| 270 | */ |
||
| 271 | protected $archiveArtefacts; |
||
| 272 | |||
| 273 | /** |
||
| 274 | * The directory where the archives will be stored. |
||
| 275 | * |
||
| 276 | * @var string |
||
| 277 | * @Type("string") |
||
| 278 | * @SerializedName("archive-dir") |
||
| 279 | */ |
||
| 280 | protected $archiveDir; |
||
| 281 | |||
| 282 | /** |
||
| 283 | * The flag to signal that the subject has to use the debug mode or not. |
||
| 284 | * |
||
| 285 | * @var boolean |
||
| 286 | * @Type("boolean") |
||
| 287 | * @SerializedName("debug-mode") |
||
| 288 | */ |
||
| 289 | protected $debugMode = false; |
||
| 290 | |||
| 291 | /** |
||
| 292 | * The log level to use (see Monolog documentation). |
||
| 293 | * |
||
| 294 | * @var string |
||
| 295 | * @Type("string") |
||
| 296 | * @SerializedName("log-level") |
||
| 297 | */ |
||
| 298 | protected $logLevel = LogLevel::INFO; |
||
| 299 | |||
| 300 | /** |
||
| 301 | * The explicit DB ID to use. |
||
| 302 | * |
||
| 303 | * @var string |
||
| 304 | * @Type("string") |
||
| 305 | * @SerializedName("use-db-id") |
||
| 306 | */ |
||
| 307 | protected $useDbId; |
||
| 308 | |||
| 309 | /** |
||
| 310 | * The explicit PID filename to use. |
||
| 311 | * |
||
| 312 | * @var string |
||
| 313 | * @Type("string") |
||
| 314 | * @SerializedName("pid-filename") |
||
| 315 | */ |
||
| 316 | protected $pidFilename; |
||
| 317 | |||
| 318 | /** |
||
| 319 | * The collection with the paths to additional vendor directories. |
||
| 320 | * |
||
| 321 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 322 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\VendorDir>") |
||
| 323 | * @SerializedName("additional-vendor-dirs") |
||
| 324 | */ |
||
| 325 | protected $additionalVendorDirs; |
||
| 326 | |||
| 327 | /** |
||
| 328 | * The array with the Magento Edition specific extension libraries. |
||
| 329 | * |
||
| 330 | * @var array |
||
| 331 | * @Type("array") |
||
| 332 | * @SerializedName("extension-libraries") |
||
| 333 | */ |
||
| 334 | protected $extensionLibraries = array(); |
||
| 335 | |||
| 336 | /** |
||
| 337 | * The array with the custom header mappings. |
||
| 338 | * |
||
| 339 | * @var array |
||
| 340 | * @Type("array") |
||
| 341 | * @SerializedName("header-mappings") |
||
| 342 | */ |
||
| 343 | protected $headerMappings = array(); |
||
| 344 | |||
| 345 | /** |
||
| 346 | * The array with the custom image types. |
||
| 347 | * |
||
| 348 | * @var array |
||
| 349 | * @Type("array") |
||
| 350 | * @SerializedName("image-types") |
||
| 351 | */ |
||
| 352 | protected $imageTypes = array(); |
||
| 353 | |||
| 354 | /** |
||
| 355 | * The flag to signal that the import should be wrapped within a single transation or not. |
||
| 356 | * |
||
| 357 | * @var boolean |
||
| 358 | * @Type("boolean") |
||
| 359 | * @SerializedName("single-transaction") |
||
| 360 | */ |
||
| 361 | protected $singleTransaction = false; |
||
| 362 | |||
| 363 | /** |
||
| 364 | * The flag to signal that the cache should be enabled or not. |
||
| 365 | * |
||
| 366 | * @var boolean |
||
| 367 | * @Type("boolean") |
||
| 368 | * @SerializedName("cache-enabled") |
||
| 369 | */ |
||
| 370 | protected $cacheEnabled = true; |
||
| 371 | |||
| 372 | /** |
||
| 373 | * ArrayCollection with the information of the configured aliases. |
||
| 374 | * |
||
| 375 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 376 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Alias>") |
||
| 377 | */ |
||
| 378 | protected $aliases; |
||
| 379 | |||
| 380 | /** |
||
| 381 | * ArrayCollection with the information of the configured caches. |
||
| 382 | * |
||
| 383 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 384 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Cache>") |
||
| 385 | */ |
||
| 386 | protected $caches; |
||
| 387 | |||
| 388 | /** |
||
| 389 | * The flag to signal that the files should be move from the source to the target directory or not. |
||
| 390 | * |
||
| 391 | * @var boolean |
||
| 392 | * @Type("boolean") |
||
| 393 | * @SerializedName("move-files") |
||
| 394 | */ |
||
| 395 | protected $moveFiles = true; |
||
| 396 | |||
| 397 | /** |
||
| 398 | * The prefix for the move files subject. |
||
| 399 | * |
||
| 400 | * @var string |
||
| 401 | * @Type("string") |
||
| 402 | * @SerializedName("move-files-prefix") |
||
| 403 | */ |
||
| 404 | protected $moveFilesPrefix; |
||
| 405 | |||
| 406 | /** |
||
| 407 | * The flag to signal that the configuration files have to be loaded, merged and compiled. |
||
| 408 | * |
||
| 409 | * @var boolean |
||
| 410 | * @Type("boolean") |
||
| 411 | * @SerializedName("compile") |
||
| 412 | */ |
||
| 413 | protected $compile = true; |
||
| 414 | |||
| 415 | /** |
||
| 416 | * The array with the shortcuts. |
||
| 417 | * |
||
| 418 | * @var array |
||
| 419 | * @Type("array<string, array<string, array>>") |
||
| 420 | * @SerializedName("shortcuts") |
||
| 421 | */ |
||
| 422 | protected $shortcuts = array(); |
||
| 423 | |||
| 424 | /** |
||
| 425 | * Return's an array with the configurations of the operations that has to be executed. |
||
| 426 | * |
||
| 427 | * @return \TechDivision\Import\Configuration\OperationConfigurationInterface[] The operations |
||
| 428 | */ |
||
| 429 | public function getOperationsToExecute() |
||
| 470 | |||
| 471 | /** |
||
| 472 | * Return's the array with the plugins of the operation to use. |
||
| 473 | * |
||
| 474 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the plugins |
||
| 475 | * @throws \Exception Is thrown, if no plugins are available for the actual operation |
||
| 476 | */ |
||
| 477 | public function getPlugins() |
||
| 516 | |||
| 517 | /** |
||
| 518 | * Return's the Entity Type to the configuration specific Magento Edition. |
||
| 519 | * |
||
| 520 | * @param string $entityType The Entity Type fot map |
||
| 521 | * |
||
| 522 | * @return string The mapped configuration specific Magento Edition |
||
| 523 | */ |
||
| 524 | protected function mapEntityTypeToMagentoEdition($entityType) |
||
| 538 | |||
| 539 | /** |
||
| 540 | * Map's the passed value to a boolean. |
||
| 541 | * |
||
| 542 | * @param string $value The value to map |
||
| 543 | * |
||
| 544 | * @return boolean The mapped value |
||
| 545 | * @throws \Exception Is thrown, if the value can't be mapped |
||
| 546 | */ |
||
| 547 | public function mapBoolean($value) |
||
| 558 | |||
| 559 | /** |
||
| 560 | * Return's the application's unique DI identifier. |
||
| 561 | * |
||
| 562 | * @return string The application's unique DI identifier |
||
| 563 | */ |
||
| 564 | public function getId() |
||
| 568 | |||
| 569 | /** |
||
| 570 | * Add's the operation with the passed name ot the operations that has to be executed. |
||
| 571 | * |
||
| 572 | * If the operation name has already been added, it'll not be added again. |
||
| 573 | * |
||
| 574 | * @param string $operationName The operation to be executed |
||
| 575 | * @param boolean $prepend TRUE if the operation name should be prepended, else FALSE |
||
| 576 | * |
||
| 577 | * @return void |
||
| 578 | */ |
||
| 579 | public function addOperationName($operationName, $prepend = false) |
||
| 590 | |||
| 591 | /** |
||
| 592 | * Return's the operation names that has to be executed. |
||
| 593 | * |
||
| 594 | * @param array $operationNames The operation names that has to be executed |
||
| 595 | * |
||
| 596 | * @return void |
||
| 597 | */ |
||
| 598 | public function setOperationNames(array $operationNames) |
||
| 602 | |||
| 603 | /** |
||
| 604 | * Return's the operation names that has to be executed. |
||
| 605 | * |
||
| 606 | * @return array The operation names that has to be executed |
||
| 607 | */ |
||
| 608 | public function getOperationNames() |
||
| 612 | |||
| 613 | /** |
||
| 614 | * Queries whether or not the passed operation has to be exceuted or not. |
||
| 615 | * |
||
| 616 | * @param \TechDivision\Import\Configuration\OperationConfigurationInterface $operation The operation to query for |
||
| 617 | * |
||
| 618 | * @return boolean TRUE if the operation has to be executed, else FALSE |
||
| 619 | */ |
||
| 620 | public function inOperationNames(OperationConfigurationInterface $operation) |
||
| 624 | |||
| 625 | /** |
||
| 626 | * Set's the Magento installation directory. |
||
| 627 | * |
||
| 628 | * @param string $installationDir The Magento installation directory |
||
| 629 | * |
||
| 630 | * @return void |
||
| 631 | */ |
||
| 632 | public function setInstallationDir($installationDir) |
||
| 636 | |||
| 637 | /** |
||
| 638 | * Return's the Magento installation directory. |
||
| 639 | * |
||
| 640 | * @return string The Magento installation directory |
||
| 641 | */ |
||
| 642 | public function getInstallationDir() |
||
| 646 | |||
| 647 | /** |
||
| 648 | * Set's the source directory that has to be watched for new files. |
||
| 649 | * |
||
| 650 | * @param string $sourceDir The source directory |
||
| 651 | * |
||
| 652 | * @return void |
||
| 653 | */ |
||
| 654 | public function setSourceDir($sourceDir) |
||
| 658 | |||
| 659 | /** |
||
| 660 | * Return's the source directory that has to be watched for new files. |
||
| 661 | * |
||
| 662 | * @return string The source directory |
||
| 663 | */ |
||
| 664 | public function getSourceDir() |
||
| 668 | |||
| 669 | /** |
||
| 670 | * Set's the target directory with the files that has been imported. |
||
| 671 | * |
||
| 672 | * @param string $targetDir The target directory |
||
| 673 | * |
||
| 674 | * @return void |
||
| 675 | */ |
||
| 676 | public function setTargetDir($targetDir) |
||
| 680 | |||
| 681 | /** |
||
| 682 | * Return's the target directory with the files that has been imported. |
||
| 683 | * |
||
| 684 | * @return string The target directory |
||
| 685 | */ |
||
| 686 | public function getTargetDir() |
||
| 690 | |||
| 691 | /** |
||
| 692 | * Set's the Magento edition, EE or CE. |
||
| 693 | * |
||
| 694 | * @param string $magentoEdition The Magento edition |
||
| 695 | * |
||
| 696 | * @return void |
||
| 697 | */ |
||
| 698 | public function setMagentoEdition($magentoEdition) |
||
| 702 | |||
| 703 | /** |
||
| 704 | * Return's the Magento edition, EE or CE. |
||
| 705 | * |
||
| 706 | * @return string The Magento edition |
||
| 707 | */ |
||
| 708 | public function getMagentoEdition() |
||
| 712 | |||
| 713 | /** |
||
| 714 | * Return's the Magento version, e. g. 2.1.0. |
||
| 715 | * |
||
| 716 | * @param string $magentoVersion The Magento version |
||
| 717 | * |
||
| 718 | * @return void |
||
| 719 | */ |
||
| 720 | public function setMagentoVersion($magentoVersion) |
||
| 724 | |||
| 725 | /** |
||
| 726 | * Return's the Magento version, e. g. 2.1.0. |
||
| 727 | * |
||
| 728 | * @return string The Magento version |
||
| 729 | */ |
||
| 730 | public function getMagentoVersion() |
||
| 734 | |||
| 735 | /** |
||
| 736 | * Return's the entity type code to be used. |
||
| 737 | * |
||
| 738 | * @return string The entity type code to be used |
||
| 739 | */ |
||
| 740 | public function getEntityTypeCode() |
||
| 744 | |||
| 745 | /** |
||
| 746 | * Set's the entity type code to be used. |
||
| 747 | * |
||
| 748 | * @param string $entityTypeCode The entity type code |
||
| 749 | * |
||
| 750 | * @return void |
||
| 751 | */ |
||
| 752 | public function setEntityTypeCode($entityTypeCode) |
||
| 756 | |||
| 757 | /** |
||
| 758 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 759 | * |
||
| 760 | * @return string The multiple field delimiter character |
||
| 761 | */ |
||
| 762 | public function getMultipleFieldDelimiter() |
||
| 766 | |||
| 767 | /** |
||
| 768 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 769 | * |
||
| 770 | * @return string The multiple value delimiter character |
||
| 771 | */ |
||
| 772 | public function getMultipleValueDelimiter() |
||
| 776 | |||
| 777 | /** |
||
| 778 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
| 779 | * |
||
| 780 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
| 781 | */ |
||
| 782 | public function isStrictMode() |
||
| 786 | |||
| 787 | /** |
||
| 788 | * Remove's all configured database configuration. |
||
| 789 | * |
||
| 790 | * @return void |
||
| 791 | */ |
||
| 792 | public function clearDatabases() |
||
| 796 | |||
| 797 | /** |
||
| 798 | * Add's the passed database configuration. |
||
| 799 | * |
||
| 800 | * @param \TechDivision\Import\Configuration\DatabaseConfigurationInterface $database The database configuration |
||
| 801 | * |
||
| 802 | * @return void |
||
| 803 | */ |
||
| 804 | public function addDatabase(DatabaseConfigurationInterface $database) |
||
| 808 | |||
| 809 | /** |
||
| 810 | * Return's the number database configurations. |
||
| 811 | * |
||
| 812 | * @return integer The number of database configurations |
||
| 813 | */ |
||
| 814 | public function countDatabases() |
||
| 818 | |||
| 819 | /** |
||
| 820 | * Return's the database configuration with the passed ID. |
||
| 821 | * |
||
| 822 | * @param string $id The ID of the database connection to return |
||
| 823 | * |
||
| 824 | * @return \TechDivision\Import\Configuration\DatabaseConfigurationInterface The database configuration |
||
| 825 | * @throws \Exception Is thrown, if no database configuration is available |
||
| 826 | */ |
||
| 827 | public function getDatabaseById($id) |
||
| 841 | |||
| 842 | /** |
||
| 843 | * Return's the databases for the given type. |
||
| 844 | * |
||
| 845 | * @param string $type The database type to return the configurations for |
||
| 846 | * |
||
| 847 | * @return \Doctrine\Common\Collections\Collection The collection with the database configurations |
||
| 848 | */ |
||
| 849 | public function getDatabasesByType($type) |
||
| 866 | |||
| 867 | /** |
||
| 868 | * Query's whether or not the passed database configuration has a valid type. |
||
| 869 | * |
||
| 870 | * @param \TechDivision\Import\Configuration\DatabaseConfigurationInterface $database The database configuration |
||
| 871 | * |
||
| 872 | * @return boolean TRUE if the passed database configuration has a valid type, else FALSE |
||
| 873 | */ |
||
| 874 | protected function isValidDatabaseType(DatabaseConfigurationInterface $database) |
||
| 878 | |||
| 879 | /** |
||
| 880 | * Return's the database configuration. |
||
| 881 | * |
||
| 882 | * If an explicit DB ID is specified, the method tries to return the database with this ID. If |
||
| 883 | * the database configuration is NOT available, an execption is thrown. |
||
| 884 | * |
||
| 885 | * If no explicit DB ID is specified, the method tries to return the default database configuration, |
||
| 886 | * if not available the first one. |
||
| 887 | * |
||
| 888 | * @return \TechDivision\Import\Configuration\DatabaseConfigurationInterface The database configuration |
||
| 889 | * @throws \Exception Is thrown, if no database configuration is available |
||
| 890 | */ |
||
| 891 | public function getDatabase() |
||
| 915 | |||
| 916 | /** |
||
| 917 | * Return's the ArrayCollection with the configured operations. |
||
| 918 | * |
||
| 919 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the operations |
||
| 920 | */ |
||
| 921 | public function getOperations() |
||
| 925 | |||
| 926 | /** |
||
| 927 | * Return's the ArrayCollection with the configured loggers. |
||
| 928 | * |
||
| 929 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the loggers |
||
| 930 | */ |
||
| 931 | public function getLoggers() |
||
| 935 | |||
| 936 | /** |
||
| 937 | * Set's the flag that import artefacts have to be archived or not. |
||
| 938 | * |
||
| 939 | * @param boolean $archiveArtefacts TRUE if artefacts have to be archived, else FALSE |
||
| 940 | * |
||
| 941 | * @return void |
||
| 942 | */ |
||
| 943 | public function setArchiveArtefacts($archiveArtefacts) |
||
| 947 | |||
| 948 | /** |
||
| 949 | * Return's the TRUE if the import artefacts have to be archived. |
||
| 950 | * |
||
| 951 | * @return boolean TRUE if the import artefacts have to be archived |
||
| 952 | */ |
||
| 953 | public function haveArchiveArtefacts() |
||
| 957 | |||
| 958 | /** |
||
| 959 | * The directory where the archives will be stored. |
||
| 960 | * |
||
| 961 | * @param string $archiveDir The archive directory |
||
| 962 | * |
||
| 963 | * @return void |
||
| 964 | */ |
||
| 965 | public function setArchiveDir($archiveDir) |
||
| 969 | |||
| 970 | /** |
||
| 971 | * The directory where the archives will be stored. |
||
| 972 | * |
||
| 973 | * @return string The archive directory |
||
| 974 | */ |
||
| 975 | public function getArchiveDir() |
||
| 979 | |||
| 980 | /** |
||
| 981 | * Set's the debug mode. |
||
| 982 | * |
||
| 983 | * @param boolean $debugMode TRUE if debug mode is enabled, else FALSE |
||
| 984 | * |
||
| 985 | * @return void |
||
| 986 | */ |
||
| 987 | public function setDebugMode($debugMode) |
||
| 991 | |||
| 992 | /** |
||
| 993 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 994 | * |
||
| 995 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 996 | */ |
||
| 997 | public function isDebugMode() |
||
| 1001 | |||
| 1002 | /** |
||
| 1003 | * Set's the log level to use. |
||
| 1004 | * |
||
| 1005 | * @param string $logLevel The log level to use |
||
| 1006 | * |
||
| 1007 | * @return void |
||
| 1008 | */ |
||
| 1009 | public function setLogLevel($logLevel) |
||
| 1013 | |||
| 1014 | /** |
||
| 1015 | * Return's the log level to use. |
||
| 1016 | * |
||
| 1017 | * @return string The log level to use |
||
| 1018 | */ |
||
| 1019 | public function getLogLevel() |
||
| 1023 | |||
| 1024 | /** |
||
| 1025 | * Set's the explicit DB ID to use. |
||
| 1026 | * |
||
| 1027 | * @param string $useDbId The explicit DB ID to use |
||
| 1028 | * |
||
| 1029 | * @return void |
||
| 1030 | */ |
||
| 1031 | public function setUseDbId($useDbId) |
||
| 1035 | |||
| 1036 | /** |
||
| 1037 | * Return's the explicit DB ID to use. |
||
| 1038 | * |
||
| 1039 | * @return string The explicit DB ID to use |
||
| 1040 | */ |
||
| 1041 | public function getUseDbId() |
||
| 1045 | |||
| 1046 | /** |
||
| 1047 | * Set's the PID filename to use. |
||
| 1048 | * |
||
| 1049 | * @param string $pidFilename The PID filename to use |
||
| 1050 | * |
||
| 1051 | * @return void |
||
| 1052 | */ |
||
| 1053 | public function setPidFilename($pidFilename) |
||
| 1057 | |||
| 1058 | /** |
||
| 1059 | * Return's the PID filename to use. |
||
| 1060 | * |
||
| 1061 | * @return string The PID filename to use |
||
| 1062 | */ |
||
| 1063 | public function getPidFilename() |
||
| 1067 | |||
| 1068 | /** |
||
| 1069 | * Set's the systemm name to be used. |
||
| 1070 | * |
||
| 1071 | * @param string $systemName The system name to be used |
||
| 1072 | * |
||
| 1073 | * @return void |
||
| 1074 | */ |
||
| 1075 | public function setSystemName($systemName) |
||
| 1079 | |||
| 1080 | /** |
||
| 1081 | * Return's the systemm name to be used. |
||
| 1082 | * |
||
| 1083 | * @return string The system name to be used |
||
| 1084 | */ |
||
| 1085 | public function getSystemName() |
||
| 1089 | |||
| 1090 | /** |
||
| 1091 | * Set's the collection with the path of the Magento Edition specific extension libraries. |
||
| 1092 | * |
||
| 1093 | * @param array $extensionLibraries The paths of the Magento Edition specific extension libraries |
||
| 1094 | * |
||
| 1095 | * @return void |
||
| 1096 | */ |
||
| 1097 | public function setExtensionLibraries(array $extensionLibraries) |
||
| 1101 | |||
| 1102 | /** |
||
| 1103 | * Return's an array with the path of the Magento Edition specific extension libraries. |
||
| 1104 | * |
||
| 1105 | * @return array The paths of the Magento Edition specific extension libraries |
||
| 1106 | */ |
||
| 1107 | public function getExtensionLibraries() |
||
| 1111 | |||
| 1112 | /** |
||
| 1113 | * Return's a collection with the path to additional vendor directories. |
||
| 1114 | * |
||
| 1115 | * @return \Doctrine\Common\Collections\ArrayCollection The paths to additional vendor directories |
||
| 1116 | */ |
||
| 1117 | public function getAdditionalVendorDirs() |
||
| 1121 | |||
| 1122 | /** |
||
| 1123 | * Lifecycle callback that will be invoked after deserialization. |
||
| 1124 | * |
||
| 1125 | * @return void |
||
| 1126 | * @PostDeserialize |
||
| 1127 | */ |
||
| 1128 | public function postDeserialize() |
||
| 1162 | |||
| 1163 | /** |
||
| 1164 | * The array with the subject's custom header mappings. |
||
| 1165 | * |
||
| 1166 | * @return array The custom header mappings |
||
| 1167 | */ |
||
| 1168 | public function getHeaderMappings() |
||
| 1182 | |||
| 1183 | /** |
||
| 1184 | * The array with the subject's custom image types. |
||
| 1185 | * |
||
| 1186 | * @return array The custom image types |
||
| 1187 | */ |
||
| 1188 | public function getImageTypes() |
||
| 1202 | |||
| 1203 | /** |
||
| 1204 | * Set's the flag that decides whether or not the import should be wrapped within a single transaction. |
||
| 1205 | * |
||
| 1206 | * @param boolean $singleTransaction TRUE if the import should be wrapped in a single transation, else FALSE |
||
| 1207 | * |
||
| 1208 | * @return void |
||
| 1209 | */ |
||
| 1210 | public function setSingleTransaction($singleTransaction) |
||
| 1214 | |||
| 1215 | /** |
||
| 1216 | * Whether or not the import should be wrapped within a single transation. |
||
| 1217 | * |
||
| 1218 | * @return boolean TRUE if the import should be wrapped in a single transation, else FALSE |
||
| 1219 | */ |
||
| 1220 | public function isSingleTransaction() |
||
| 1224 | |||
| 1225 | /** |
||
| 1226 | * Set's the flag that decides whether or not the the cache has been enabled. |
||
| 1227 | * |
||
| 1228 | * @param boolean $cacheEnabled TRUE if the cache has been enabled, else FALSE |
||
| 1229 | * |
||
| 1230 | * @return void |
||
| 1231 | */ |
||
| 1232 | public function setCacheEnabled($cacheEnabled) |
||
| 1236 | |||
| 1237 | /** |
||
| 1238 | * Whether or not the cache functionality should be enabled. |
||
| 1239 | * |
||
| 1240 | * @return boolean TRUE if the cache has to be enabled, else FALSE |
||
| 1241 | */ |
||
| 1242 | public function isCacheEnabled() |
||
| 1246 | |||
| 1247 | /** |
||
| 1248 | * Set's the passed serial from the commandline to the configuration. |
||
| 1249 | * |
||
| 1250 | * @param string $serial The serial from the commandline |
||
| 1251 | * |
||
| 1252 | * @return void |
||
| 1253 | */ |
||
| 1254 | public function setSerial($serial) |
||
| 1258 | |||
| 1259 | /** |
||
| 1260 | * Return's the serial from the commandline. |
||
| 1261 | * |
||
| 1262 | * @return string The serial |
||
| 1263 | */ |
||
| 1264 | public function getSerial() |
||
| 1268 | |||
| 1269 | /** |
||
| 1270 | * Return's the configuration for the caches. |
||
| 1271 | * |
||
| 1272 | * @return \Doctrine\Common\Collections\ArrayCollection The cache configurations |
||
| 1273 | */ |
||
| 1274 | public function getCaches() |
||
| 1285 | |||
| 1286 | /** |
||
| 1287 | * Return's the cache configuration for the passed type. |
||
| 1288 | * |
||
| 1289 | * @param string $type The cache type to return the configuation for |
||
| 1290 | * |
||
| 1291 | * @return \TechDivision\Import\Configuration\CacheConfigurationInterface The cache configuration |
||
| 1292 | */ |
||
| 1293 | public function getCacheByType($type) |
||
| 1307 | |||
| 1308 | /** |
||
| 1309 | * Return's the alias configuration. |
||
| 1310 | * |
||
| 1311 | * @return \Doctrine\Common\Collections\ArrayCollection The alias configuration |
||
| 1312 | */ |
||
| 1313 | public function getAliases() |
||
| 1317 | |||
| 1318 | /** |
||
| 1319 | * Set's the prefix for the move files subject. |
||
| 1320 | * |
||
| 1321 | * @param string $moveFilesPrefix The prefix for the move files subject |
||
| 1322 | * |
||
| 1323 | * @return void |
||
| 1324 | */ |
||
| 1325 | public function setMoveFilesPrefix($moveFilesPrefix) |
||
| 1329 | |||
| 1330 | /** |
||
| 1331 | * Return's the prefix for the move files subject. |
||
| 1332 | * |
||
| 1333 | * @return string The prefix for the move files subject |
||
| 1334 | * |
||
| 1335 | * @return string The prefix for the move files subject |
||
| 1336 | */ |
||
| 1337 | public function getMoveFilesPrefix() |
||
| 1341 | |||
| 1342 | /** |
||
| 1343 | * Set's the flag that whether the files have to be moved from the source to the target directory or not. |
||
| 1344 | * |
||
| 1345 | * @param boolean $moveFiles TRUE if the files should be moved, else FALSE |
||
| 1346 | * |
||
| 1347 | * return void |
||
| 1348 | */ |
||
| 1349 | public function setMoveFiles($moveFiles) |
||
| 1353 | |||
| 1354 | /** |
||
| 1355 | * Whether or not the files should be moved from the source to the target directory. |
||
| 1356 | * |
||
| 1357 | * @return TRUE if the files should be moved, FALSE otherwise |
||
| 1358 | */ |
||
| 1359 | public function shouldMoveFiles() |
||
| 1363 | |||
| 1364 | /** |
||
| 1365 | * Set's the flag that whether the configuration files have to be compiled or not. |
||
| 1366 | * |
||
| 1367 | * @param boolean $compile TRUE if the configuration files have to be compiled, else FALSE |
||
| 1368 | * |
||
| 1369 | * return void |
||
| 1370 | */ |
||
| 1371 | public function setCompile($compile) |
||
| 1375 | |||
| 1376 | /** |
||
| 1377 | * Whether or not the configuration files have to be compiled or not. |
||
| 1378 | * |
||
| 1379 | * @return TRUE if the configuration files have to be compiled, FALSE otherwise |
||
| 1380 | */ |
||
| 1381 | public function shouldCompile() |
||
| 1385 | } |
||
| 1386 |