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 | * The serial that will be passed as commandline option (can not be specified in configuration file). |
||
| 111 | * |
||
| 112 | * @var string |
||
| 113 | * @Exclude |
||
| 114 | */ |
||
| 115 | protected $serial; |
||
| 116 | |||
| 117 | /** |
||
| 118 | * The application's unique DI identifier. |
||
| 119 | * |
||
| 120 | * @var string |
||
| 121 | * @Type("string") |
||
| 122 | * @SerializedName("id") |
||
| 123 | */ |
||
| 124 | protected $id; |
||
| 125 | |||
| 126 | /** |
||
| 127 | * The system name to use. |
||
| 128 | * |
||
| 129 | * @var string |
||
| 130 | * @Type("string") |
||
| 131 | * @SerializedName("system-name") |
||
| 132 | */ |
||
| 133 | protected $systemName; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * The operation names to be executed. |
||
| 137 | * |
||
| 138 | * @var array |
||
| 139 | * @Type("array<string>") |
||
| 140 | * @SerializedName("operation-names") |
||
| 141 | */ |
||
| 142 | protected $operationNames = array(); |
||
| 143 | |||
| 144 | /** |
||
| 145 | * The entity type code to use. |
||
| 146 | * |
||
| 147 | * @var string |
||
| 148 | * @Type("string") |
||
| 149 | * @SerializedName("entity-type-code") |
||
| 150 | */ |
||
| 151 | protected $entityTypeCode; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * The Magento installation directory. |
||
| 155 | * |
||
| 156 | * @var string |
||
| 157 | * @Type("string") |
||
| 158 | * @SerializedName("installation-dir") |
||
| 159 | */ |
||
| 160 | protected $installationDir; |
||
| 161 | |||
| 162 | /** |
||
| 163 | * The source directory that has to be watched for new files. |
||
| 164 | * |
||
| 165 | * @var string |
||
| 166 | * @Type("string") |
||
| 167 | * @SerializedName("source-dir") |
||
| 168 | */ |
||
| 169 | protected $sourceDir; |
||
| 170 | |||
| 171 | /** |
||
| 172 | * The target directory with the files that has been imported. |
||
| 173 | * |
||
| 174 | * @var string |
||
| 175 | * @Type("string") |
||
| 176 | * @SerializedName("target-dir") |
||
| 177 | */ |
||
| 178 | protected $targetDir; |
||
| 179 | |||
| 180 | /** |
||
| 181 | * The Magento edition, EE or CE. |
||
| 182 | * |
||
| 183 | * @var string |
||
| 184 | * @Type("string") |
||
| 185 | * @SerializedName("magento-edition") |
||
| 186 | */ |
||
| 187 | protected $magentoEdition = 'CE'; |
||
| 188 | |||
| 189 | /** |
||
| 190 | * The Magento version, e. g. 2.2.0. |
||
| 191 | * |
||
| 192 | * @var string |
||
| 193 | * @Type("string") |
||
| 194 | * @SerializedName("magento-version") |
||
| 195 | */ |
||
| 196 | protected $magentoVersion = '2.2.0'; |
||
| 197 | |||
| 198 | /** |
||
| 199 | * ArrayCollection with the information of the configured databases. |
||
| 200 | * |
||
| 201 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 202 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Database>") |
||
| 203 | */ |
||
| 204 | protected $databases; |
||
| 205 | |||
| 206 | /** |
||
| 207 | * ArrayCollection with the information of the configured loggers. |
||
| 208 | * |
||
| 209 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 210 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Logger>") |
||
| 211 | */ |
||
| 212 | protected $loggers; |
||
| 213 | |||
| 214 | /** |
||
| 215 | * ArrayCollection with the information of the configured operations. |
||
| 216 | * |
||
| 217 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 218 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Operation>") |
||
| 219 | */ |
||
| 220 | protected $operations; |
||
| 221 | |||
| 222 | /** |
||
| 223 | * The subject's multiple field delimiter character for fields with multiple values, defaults to (,). |
||
| 224 | * |
||
| 225 | * @var string |
||
| 226 | * @Type("string") |
||
| 227 | * @SerializedName("multiple-field-delimiter") |
||
| 228 | */ |
||
| 229 | protected $multipleFieldDelimiter = ','; |
||
| 230 | |||
| 231 | /** |
||
| 232 | * The subject's multiple value delimiter character for fields with multiple values, defaults to (|). |
||
| 233 | * |
||
| 234 | * @var string |
||
| 235 | * @Type("string") |
||
| 236 | * @SerializedName("multiple-value-delimiter") |
||
| 237 | */ |
||
| 238 | protected $multipleValueDelimiter = '|'; |
||
| 239 | |||
| 240 | /** |
||
| 241 | * The flag to signal that the subject has to use the strict mode or not. |
||
| 242 | * |
||
| 243 | * @var boolean |
||
| 244 | * @Type("boolean") |
||
| 245 | * @SerializedName("strict-mode") |
||
| 246 | */ |
||
| 247 | protected $strictMode; |
||
| 248 | |||
| 249 | /** |
||
| 250 | * The flag whether or not the import artefacts have to be archived. |
||
| 251 | * |
||
| 252 | * @var boolean |
||
| 253 | * @Type("boolean") |
||
| 254 | * @SerializedName("archive-artefacts") |
||
| 255 | */ |
||
| 256 | protected $archiveArtefacts; |
||
| 257 | |||
| 258 | /** |
||
| 259 | * The directory where the archives will be stored. |
||
| 260 | * |
||
| 261 | * @var string |
||
| 262 | * @Type("string") |
||
| 263 | * @SerializedName("archive-dir") |
||
| 264 | */ |
||
| 265 | protected $archiveDir; |
||
| 266 | |||
| 267 | /** |
||
| 268 | * The flag to signal that the subject has to use the debug mode or not. |
||
| 269 | * |
||
| 270 | * @var boolean |
||
| 271 | * @Type("boolean") |
||
| 272 | * @SerializedName("debug-mode") |
||
| 273 | */ |
||
| 274 | protected $debugMode = false; |
||
| 275 | |||
| 276 | /** |
||
| 277 | * The log level to use (see Monolog documentation). |
||
| 278 | * |
||
| 279 | * @var string |
||
| 280 | * @Type("string") |
||
| 281 | * @SerializedName("log-level") |
||
| 282 | */ |
||
| 283 | protected $logLevel = LogLevel::INFO; |
||
| 284 | |||
| 285 | /** |
||
| 286 | * The explicit DB ID to use. |
||
| 287 | * |
||
| 288 | * @var string |
||
| 289 | * @Type("string") |
||
| 290 | * @SerializedName("use-db-id") |
||
| 291 | */ |
||
| 292 | protected $useDbId; |
||
| 293 | |||
| 294 | /** |
||
| 295 | * The explicit PID filename to use. |
||
| 296 | * |
||
| 297 | * @var string |
||
| 298 | * @Type("string") |
||
| 299 | * @SerializedName("pid-filename") |
||
| 300 | */ |
||
| 301 | protected $pidFilename; |
||
| 302 | |||
| 303 | /** |
||
| 304 | * The collection with the paths to additional vendor directories. |
||
| 305 | * |
||
| 306 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 307 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\VendorDir>") |
||
| 308 | * @SerializedName("additional-vendor-dirs") |
||
| 309 | */ |
||
| 310 | protected $additionalVendorDirs; |
||
| 311 | |||
| 312 | /** |
||
| 313 | * The array with the Magento Edition specific extension libraries. |
||
| 314 | * |
||
| 315 | * @var array |
||
| 316 | * @Type("array") |
||
| 317 | * @SerializedName("extension-libraries") |
||
| 318 | */ |
||
| 319 | protected $extensionLibraries = array(); |
||
| 320 | |||
| 321 | /** |
||
| 322 | * The array with the custom header mappings. |
||
| 323 | * |
||
| 324 | * @var array |
||
| 325 | * @Type("array") |
||
| 326 | * @SerializedName("header-mappings") |
||
| 327 | */ |
||
| 328 | protected $headerMappings = array(); |
||
| 329 | |||
| 330 | /** |
||
| 331 | * The array with the custom image types. |
||
| 332 | * |
||
| 333 | * @var array |
||
| 334 | * @Type("array") |
||
| 335 | * @SerializedName("image-types") |
||
| 336 | */ |
||
| 337 | protected $imageTypes = array(); |
||
| 338 | |||
| 339 | /** |
||
| 340 | * The flag to signal that the import should be wrapped within a single transation or not. |
||
| 341 | * |
||
| 342 | * @var boolean |
||
| 343 | * @Type("boolean") |
||
| 344 | * @SerializedName("single-transaction") |
||
| 345 | */ |
||
| 346 | protected $singleTransaction = false; |
||
| 347 | |||
| 348 | /** |
||
| 349 | * The flag to signal that the cache should be enabled or not. |
||
| 350 | * |
||
| 351 | * @var boolean |
||
| 352 | * @Type("boolean") |
||
| 353 | * @SerializedName("cache-enabled") |
||
| 354 | */ |
||
| 355 | protected $cacheEnabled = true; |
||
| 356 | |||
| 357 | /** |
||
| 358 | * ArrayCollection with the information of the configured aliases. |
||
| 359 | * |
||
| 360 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 361 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Alias>") |
||
| 362 | */ |
||
| 363 | protected $aliases; |
||
| 364 | |||
| 365 | /** |
||
| 366 | * ArrayCollection with the information of the configured caches. |
||
| 367 | * |
||
| 368 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 369 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Cache>") |
||
| 370 | */ |
||
| 371 | protected $caches; |
||
| 372 | |||
| 373 | /** |
||
| 374 | * The flag to signal that the files should be move from the source to the target directory or not. |
||
| 375 | * |
||
| 376 | * @var boolean |
||
| 377 | * @Type("boolean") |
||
| 378 | * @SerializedName("move-files") |
||
| 379 | */ |
||
| 380 | protected $moveFiles = true; |
||
| 381 | |||
| 382 | /** |
||
| 383 | * The prefix for the move files subject. |
||
| 384 | * |
||
| 385 | * @var string |
||
| 386 | * @Type("string") |
||
| 387 | * @SerializedName("move-files-prefix") |
||
| 388 | */ |
||
| 389 | protected $moveFilesPrefix; |
||
| 390 | |||
| 391 | /** |
||
| 392 | * Return's the array with the plugins of the operation to use. |
||
| 393 | * |
||
| 394 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the plugins |
||
| 395 | * @throws \Exception Is thrown, if no plugins are available for the actual operation |
||
| 396 | */ |
||
| 397 | public function getPlugins() |
||
| 438 | |||
| 439 | /** |
||
| 440 | * Map's the passed value to a boolean. |
||
| 441 | * |
||
| 442 | * @param string $value The value to map |
||
| 443 | * |
||
| 444 | * @return boolean The mapped value |
||
| 445 | * @throws \Exception Is thrown, if the value can't be mapped |
||
| 446 | */ |
||
| 447 | public function mapBoolean($value) |
||
| 458 | |||
| 459 | /** |
||
| 460 | * Return's the application's unique DI identifier. |
||
| 461 | * |
||
| 462 | * @return string The application's unique DI identifier |
||
| 463 | */ |
||
| 464 | public function getId() |
||
| 468 | |||
| 469 | /** |
||
| 470 | * Add's the operation with the passed name ot the operations that has to be executed. |
||
| 471 | * |
||
| 472 | * If the operation name has already been added, it'll not be added again. |
||
| 473 | * |
||
| 474 | * @param string $operationName The operation to be executed |
||
| 475 | * @param boolean $prepend TRUE if the operation name should be prepended, else FALSE |
||
| 476 | * |
||
| 477 | * @return void |
||
| 478 | */ |
||
| 479 | public function addOperationName($operationName, $prepend = false) |
||
| 490 | |||
| 491 | /** |
||
| 492 | * Return's the operation names that has to be executed. |
||
| 493 | * |
||
| 494 | * @param array $operationNames The operation names that has to be executed |
||
| 495 | * |
||
| 496 | * @return void |
||
| 497 | */ |
||
| 498 | public function setOperationNames(array $operationNames) |
||
| 502 | |||
| 503 | /** |
||
| 504 | * Return's the operation names that has to be executed. |
||
| 505 | * |
||
| 506 | * @return array The operation names that has to be executed |
||
| 507 | */ |
||
| 508 | public function getOperationNames() |
||
| 512 | |||
| 513 | /** |
||
| 514 | * Queries whether or not the passed operation has to be exceuted or not. |
||
| 515 | * |
||
| 516 | * @param \TechDivision\Import\Configuration\OperationConfigurationInterface $operation The operation to query for |
||
| 517 | * |
||
| 518 | * @return boolean TRUE if the operation has to be executed, else FALSE |
||
| 519 | */ |
||
| 520 | public function inOperationNames(OperationConfigurationInterface $operation) |
||
| 524 | |||
| 525 | /** |
||
| 526 | * Set's the Magento installation directory. |
||
| 527 | * |
||
| 528 | * @param string $installationDir The Magento installation directory |
||
| 529 | * |
||
| 530 | * @return void |
||
| 531 | */ |
||
| 532 | public function setInstallationDir($installationDir) |
||
| 536 | |||
| 537 | /** |
||
| 538 | * Return's the Magento installation directory. |
||
| 539 | * |
||
| 540 | * @return string The Magento installation directory |
||
| 541 | */ |
||
| 542 | public function getInstallationDir() |
||
| 546 | |||
| 547 | /** |
||
| 548 | * Set's the source directory that has to be watched for new files. |
||
| 549 | * |
||
| 550 | * @param string $sourceDir The source directory |
||
| 551 | * |
||
| 552 | * @return void |
||
| 553 | */ |
||
| 554 | public function setSourceDir($sourceDir) |
||
| 558 | |||
| 559 | /** |
||
| 560 | * Return's the source directory that has to be watched for new files. |
||
| 561 | * |
||
| 562 | * @return string The source directory |
||
| 563 | */ |
||
| 564 | public function getSourceDir() |
||
| 568 | |||
| 569 | /** |
||
| 570 | * Set's the target directory with the files that has been imported. |
||
| 571 | * |
||
| 572 | * @param string $targetDir The target directory |
||
| 573 | * |
||
| 574 | * @return void |
||
| 575 | */ |
||
| 576 | public function setTargetDir($targetDir) |
||
| 580 | |||
| 581 | /** |
||
| 582 | * Return's the target directory with the files that has been imported. |
||
| 583 | * |
||
| 584 | * @return string The target directory |
||
| 585 | */ |
||
| 586 | public function getTargetDir() |
||
| 590 | |||
| 591 | /** |
||
| 592 | * Set's the Magento edition, EE or CE. |
||
| 593 | * |
||
| 594 | * @param string $magentoEdition The Magento edition |
||
| 595 | * |
||
| 596 | * @return void |
||
| 597 | */ |
||
| 598 | public function setMagentoEdition($magentoEdition) |
||
| 602 | |||
| 603 | /** |
||
| 604 | * Return's the Magento edition, EE or CE. |
||
| 605 | * |
||
| 606 | * @return string The Magento edition |
||
| 607 | */ |
||
| 608 | public function getMagentoEdition() |
||
| 612 | |||
| 613 | /** |
||
| 614 | * Return's the Magento version, e. g. 2.1.0. |
||
| 615 | * |
||
| 616 | * @param string $magentoVersion The Magento version |
||
| 617 | * |
||
| 618 | * @return void |
||
| 619 | */ |
||
| 620 | public function setMagentoVersion($magentoVersion) |
||
| 624 | |||
| 625 | /** |
||
| 626 | * Return's the Magento version, e. g. 2.1.0. |
||
| 627 | * |
||
| 628 | * @return string The Magento version |
||
| 629 | */ |
||
| 630 | public function getMagentoVersion() |
||
| 634 | |||
| 635 | /** |
||
| 636 | * Return's the entity type code to be used. |
||
| 637 | * |
||
| 638 | * @return string The entity type code to be used |
||
| 639 | */ |
||
| 640 | public function getEntityTypeCode() |
||
| 644 | |||
| 645 | /** |
||
| 646 | * Set's the entity type code to be used. |
||
| 647 | * |
||
| 648 | * @param string $entityTypeCode The entity type code |
||
| 649 | * |
||
| 650 | * @return void |
||
| 651 | */ |
||
| 652 | public function setEntityTypeCode($entityTypeCode) |
||
| 656 | |||
| 657 | /** |
||
| 658 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 659 | * |
||
| 660 | * @return string The multiple field delimiter character |
||
| 661 | */ |
||
| 662 | public function getMultipleFieldDelimiter() |
||
| 666 | |||
| 667 | /** |
||
| 668 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 669 | * |
||
| 670 | * @return string The multiple value delimiter character |
||
| 671 | */ |
||
| 672 | public function getMultipleValueDelimiter() |
||
| 676 | |||
| 677 | /** |
||
| 678 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
| 679 | * |
||
| 680 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
| 681 | */ |
||
| 682 | public function isStrictMode() |
||
| 686 | |||
| 687 | /** |
||
| 688 | * Remove's all configured database configuration. |
||
| 689 | * |
||
| 690 | * @return void |
||
| 691 | */ |
||
| 692 | public function clearDatabases() |
||
| 696 | |||
| 697 | /** |
||
| 698 | * Add's the passed database configuration. |
||
| 699 | * |
||
| 700 | * @param \TechDivision\Import\Configuration\DatabaseConfigurationInterface $database The database configuration |
||
| 701 | * |
||
| 702 | * @return void |
||
| 703 | */ |
||
| 704 | public function addDatabase(DatabaseConfigurationInterface $database) |
||
| 708 | |||
| 709 | /** |
||
| 710 | * Return's the number database configurations. |
||
| 711 | * |
||
| 712 | * @return integer The number of database configurations |
||
| 713 | */ |
||
| 714 | public function countDatabases() |
||
| 718 | |||
| 719 | /** |
||
| 720 | * Return's the database configuration with the passed ID. |
||
| 721 | * |
||
| 722 | * @param string $id The ID of the database connection to return |
||
| 723 | * |
||
| 724 | * @return \TechDivision\Import\Configuration\DatabaseConfigurationInterface The database configuration |
||
| 725 | * @throws \Exception Is thrown, if no database configuration is available |
||
| 726 | */ |
||
| 727 | public function getDatabaseById($id) |
||
| 741 | |||
| 742 | /** |
||
| 743 | * Return's the databases for the given type. |
||
| 744 | * |
||
| 745 | * @param string $type The database type to return the configurations for |
||
| 746 | * |
||
| 747 | * @return \Doctrine\Common\Collections\Collection The collection with the database configurations |
||
| 748 | */ |
||
| 749 | public function getDatabasesByType($type) |
||
| 766 | |||
| 767 | /** |
||
| 768 | * Query's whether or not the passed database configuration has a valid type. |
||
| 769 | * |
||
| 770 | * @param \TechDivision\Import\Configuration\DatabaseConfigurationInterface $database The database configuration |
||
| 771 | * |
||
| 772 | * @return boolean TRUE if the passed database configuration has a valid type, else FALSE |
||
| 773 | */ |
||
| 774 | protected function isValidDatabaseType(DatabaseConfigurationInterface $database) |
||
| 778 | |||
| 779 | /** |
||
| 780 | * Return's the database configuration. |
||
| 781 | * |
||
| 782 | * If an explicit DB ID is specified, the method tries to return the database with this ID. If |
||
| 783 | * the database configuration is NOT available, an execption is thrown. |
||
| 784 | * |
||
| 785 | * If no explicit DB ID is specified, the method tries to return the default database configuration, |
||
| 786 | * if not available the first one. |
||
| 787 | * |
||
| 788 | * @return \TechDivision\Import\Configuration\DatabaseConfigurationInterface The database configuration |
||
| 789 | * @throws \Exception Is thrown, if no database configuration is available |
||
| 790 | */ |
||
| 791 | public function getDatabase() |
||
| 815 | |||
| 816 | /** |
||
| 817 | * Return's the ArrayCollection with the configured operations. |
||
| 818 | * |
||
| 819 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the operations |
||
| 820 | */ |
||
| 821 | public function getOperations() |
||
| 825 | |||
| 826 | /** |
||
| 827 | * Return's the ArrayCollection with the configured loggers. |
||
| 828 | * |
||
| 829 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the loggers |
||
| 830 | */ |
||
| 831 | public function getLoggers() |
||
| 835 | |||
| 836 | /** |
||
| 837 | * Set's the flag that import artefacts have to be archived or not. |
||
| 838 | * |
||
| 839 | * @param boolean $archiveArtefacts TRUE if artefacts have to be archived, else FALSE |
||
| 840 | * |
||
| 841 | * @return void |
||
| 842 | */ |
||
| 843 | public function setArchiveArtefacts($archiveArtefacts) |
||
| 847 | |||
| 848 | /** |
||
| 849 | * Return's the TRUE if the import artefacts have to be archived. |
||
| 850 | * |
||
| 851 | * @return boolean TRUE if the import artefacts have to be archived |
||
| 852 | */ |
||
| 853 | public function haveArchiveArtefacts() |
||
| 857 | |||
| 858 | /** |
||
| 859 | * The directory where the archives will be stored. |
||
| 860 | * |
||
| 861 | * @param string $archiveDir The archive directory |
||
| 862 | * |
||
| 863 | * @return void |
||
| 864 | */ |
||
| 865 | public function setArchiveDir($archiveDir) |
||
| 869 | |||
| 870 | /** |
||
| 871 | * The directory where the archives will be stored. |
||
| 872 | * |
||
| 873 | * @return string The archive directory |
||
| 874 | */ |
||
| 875 | public function getArchiveDir() |
||
| 879 | |||
| 880 | /** |
||
| 881 | * Set's the debug mode. |
||
| 882 | * |
||
| 883 | * @param boolean $debugMode TRUE if debug mode is enabled, else FALSE |
||
| 884 | * |
||
| 885 | * @return void |
||
| 886 | */ |
||
| 887 | public function setDebugMode($debugMode) |
||
| 891 | |||
| 892 | /** |
||
| 893 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 894 | * |
||
| 895 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 896 | */ |
||
| 897 | public function isDebugMode() |
||
| 901 | |||
| 902 | /** |
||
| 903 | * Set's the log level to use. |
||
| 904 | * |
||
| 905 | * @param string $logLevel The log level to use |
||
| 906 | * |
||
| 907 | * @return void |
||
| 908 | */ |
||
| 909 | public function setLogLevel($logLevel) |
||
| 913 | |||
| 914 | /** |
||
| 915 | * Return's the log level to use. |
||
| 916 | * |
||
| 917 | * @return string The log level to use |
||
| 918 | */ |
||
| 919 | public function getLogLevel() |
||
| 923 | |||
| 924 | /** |
||
| 925 | * Set's the explicit DB ID to use. |
||
| 926 | * |
||
| 927 | * @param string $useDbId The explicit DB ID to use |
||
| 928 | * |
||
| 929 | * @return void |
||
| 930 | */ |
||
| 931 | public function setUseDbId($useDbId) |
||
| 935 | |||
| 936 | /** |
||
| 937 | * Return's the explicit DB ID to use. |
||
| 938 | * |
||
| 939 | * @return string The explicit DB ID to use |
||
| 940 | */ |
||
| 941 | public function getUseDbId() |
||
| 945 | |||
| 946 | /** |
||
| 947 | * Set's the PID filename to use. |
||
| 948 | * |
||
| 949 | * @param string $pidFilename The PID filename to use |
||
| 950 | * |
||
| 951 | * @return void |
||
| 952 | */ |
||
| 953 | public function setPidFilename($pidFilename) |
||
| 957 | |||
| 958 | /** |
||
| 959 | * Return's the PID filename to use. |
||
| 960 | * |
||
| 961 | * @return string The PID filename to use |
||
| 962 | */ |
||
| 963 | public function getPidFilename() |
||
| 967 | |||
| 968 | /** |
||
| 969 | * Set's the systemm name to be used. |
||
| 970 | * |
||
| 971 | * @param string $systemName The system name to be used |
||
| 972 | * |
||
| 973 | * @return void |
||
| 974 | */ |
||
| 975 | public function setSystemName($systemName) |
||
| 979 | |||
| 980 | /** |
||
| 981 | * Return's the systemm name to be used. |
||
| 982 | * |
||
| 983 | * @return string The system name to be used |
||
| 984 | */ |
||
| 985 | public function getSystemName() |
||
| 989 | |||
| 990 | /** |
||
| 991 | * Set's the collection with the path of the Magento Edition specific extension libraries. |
||
| 992 | * |
||
| 993 | * @param array $extensionLibraries The paths of the Magento Edition specific extension libraries |
||
| 994 | * |
||
| 995 | * @return void |
||
| 996 | */ |
||
| 997 | public function setExtensionLibraries(array $extensionLibraries) |
||
| 1001 | |||
| 1002 | /** |
||
| 1003 | * Return's an array with the path of the Magento Edition specific extension libraries. |
||
| 1004 | * |
||
| 1005 | * @return array The paths of the Magento Edition specific extension libraries |
||
| 1006 | */ |
||
| 1007 | public function getExtensionLibraries() |
||
| 1011 | |||
| 1012 | /** |
||
| 1013 | * Return's a collection with the path to additional vendor directories. |
||
| 1014 | * |
||
| 1015 | * @return \Doctrine\Common\Collections\ArrayCollection The paths to additional vendor directories |
||
| 1016 | */ |
||
| 1017 | public function getAdditionalVendorDirs() |
||
| 1021 | |||
| 1022 | /** |
||
| 1023 | * Lifecycle callback that will be invoked after deserialization. |
||
| 1024 | * |
||
| 1025 | * @return void |
||
| 1026 | * @PostDeserialize |
||
| 1027 | */ |
||
| 1028 | public function postDeserialize() |
||
| 1056 | |||
| 1057 | /** |
||
| 1058 | * The array with the subject's custom header mappings. |
||
| 1059 | * |
||
| 1060 | * @return array The custom header mappings |
||
| 1061 | */ |
||
| 1062 | public function getHeaderMappings() |
||
| 1076 | |||
| 1077 | /** |
||
| 1078 | * The array with the subject's custom image types. |
||
| 1079 | * |
||
| 1080 | * @return array The custom image types |
||
| 1081 | */ |
||
| 1082 | public function getImageTypes() |
||
| 1096 | |||
| 1097 | /** |
||
| 1098 | * Set's the flag that decides whether or not the import should be wrapped within a single transaction. |
||
| 1099 | * |
||
| 1100 | * @param boolean $singleTransaction TRUE if the import should be wrapped in a single transation, else FALSE |
||
| 1101 | * |
||
| 1102 | * @return void |
||
| 1103 | */ |
||
| 1104 | public function setSingleTransaction($singleTransaction) |
||
| 1108 | |||
| 1109 | /** |
||
| 1110 | * Whether or not the import should be wrapped within a single transation. |
||
| 1111 | * |
||
| 1112 | * @return boolean TRUE if the import should be wrapped in a single transation, else FALSE |
||
| 1113 | */ |
||
| 1114 | public function isSingleTransaction() |
||
| 1118 | |||
| 1119 | /** |
||
| 1120 | * Set's the flag that decides whether or not the the cache has been enabled. |
||
| 1121 | * |
||
| 1122 | * @param boolean $cacheEnabled TRUE if the cache has been enabled, else FALSE |
||
| 1123 | * |
||
| 1124 | * @return void |
||
| 1125 | */ |
||
| 1126 | public function setCacheEnabled($cacheEnabled) |
||
| 1130 | |||
| 1131 | /** |
||
| 1132 | * Whether or not the cache functionality should be enabled. |
||
| 1133 | * |
||
| 1134 | * @return boolean TRUE if the cache has to be enabled, else FALSE |
||
| 1135 | */ |
||
| 1136 | public function isCacheEnabled() |
||
| 1140 | |||
| 1141 | /** |
||
| 1142 | * Set's the passed serial from the commandline to the configuration. |
||
| 1143 | * |
||
| 1144 | * @param string $serial The serial from the commandline |
||
| 1145 | * |
||
| 1146 | * @return void |
||
| 1147 | */ |
||
| 1148 | public function setSerial($serial) |
||
| 1152 | |||
| 1153 | /** |
||
| 1154 | * Return's the serial from the commandline. |
||
| 1155 | * |
||
| 1156 | * @return string The serial |
||
| 1157 | */ |
||
| 1158 | public function getSerial() |
||
| 1162 | |||
| 1163 | /** |
||
| 1164 | * Return's the configuration for the caches. |
||
| 1165 | * |
||
| 1166 | * @return \Doctrine\Common\Collections\ArrayCollection The cache configurations |
||
| 1167 | */ |
||
| 1168 | public function getCaches() |
||
| 1179 | |||
| 1180 | /** |
||
| 1181 | * Return's the cache configuration for the passed type. |
||
| 1182 | * |
||
| 1183 | * @param string $type The cache type to return the configuation for |
||
| 1184 | * |
||
| 1185 | * @return \TechDivision\Import\Configuration\CacheConfigurationInterface The cache configuration |
||
| 1186 | */ |
||
| 1187 | public function getCacheByType($type) |
||
| 1201 | |||
| 1202 | /** |
||
| 1203 | * Return's the alias configuration. |
||
| 1204 | * |
||
| 1205 | * @return \Doctrine\Common\Collections\ArrayCollection The alias configuration |
||
| 1206 | */ |
||
| 1207 | public function getAliases() |
||
| 1211 | |||
| 1212 | /** |
||
| 1213 | * Set's the prefix for the move files subject. |
||
| 1214 | * |
||
| 1215 | * @param string $moveFilesPrefix The prefix for the move files subject |
||
| 1216 | * |
||
| 1217 | * @return void |
||
| 1218 | */ |
||
| 1219 | public function setMoveFilesPrefix($moveFilesPrefix) |
||
| 1223 | |||
| 1224 | /** |
||
| 1225 | * Return's the prefix for the move files subject. |
||
| 1226 | * |
||
| 1227 | * @return string The prefix for the move files subject |
||
| 1228 | * |
||
| 1229 | * @return string The prefix for the move files subject |
||
| 1230 | */ |
||
| 1231 | public function getMoveFilesPrefix() |
||
| 1235 | |||
| 1236 | /** |
||
| 1237 | * Set's the flag that whether the files have to be moved from the source to the target directory or not. |
||
| 1238 | * |
||
| 1239 | * @param boolean $moveFiles TRUE if the files should be moved, else FALSE |
||
| 1240 | * |
||
| 1241 | * return void |
||
| 1242 | */ |
||
| 1243 | public function setMoveFiles($moveFiles) |
||
| 1247 | |||
| 1248 | /** |
||
| 1249 | * Whether or not the files should be moved from the source to the target directory. |
||
| 1250 | * |
||
| 1251 | * @return TRUE if the files should be moved, FALSE otherwise |
||
| 1252 | */ |
||
| 1253 | public function shouldMoveFiles() |
||
| 1257 | } |
||
| 1258 |