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 |
||
| 49 | class Configuration implements ConfigurationInterface, ListenerAwareConfigurationInterface |
||
| 50 | { |
||
| 51 | |||
| 52 | /** |
||
| 53 | * The default PID filename to use. |
||
| 54 | * |
||
| 55 | * @var string |
||
| 56 | */ |
||
| 57 | const PID_FILENAME = 'importer.pid'; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Trait that provides CSV configuration functionality. |
||
| 61 | * |
||
| 62 | * @var \TechDivision\Import\Configuration\Jms\Configuration\CsvTrait |
||
| 63 | */ |
||
| 64 | use CsvTrait; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Trait that provides CSV configuration functionality. |
||
| 68 | * |
||
| 69 | * @var \TechDivision\Import\Configuration\Jms\Configuration\ParamsTrait |
||
| 70 | */ |
||
| 71 | use ParamsTrait; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Trait that provides CSV configuration functionality. |
||
| 75 | * |
||
| 76 | * @var \TechDivision\Import\Configuration\Jms\Configuration\ListenersTrait |
||
| 77 | */ |
||
| 78 | use ListenersTrait; |
||
| 79 | |||
| 80 | /** |
||
| 81 | * The array with the available database types. |
||
| 82 | * |
||
| 83 | * @var array |
||
| 84 | * @Exclude |
||
| 85 | */ |
||
| 86 | protected $availableDatabaseTypes = array( |
||
| 87 | DatabaseConfigurationInterface::TYPE_MYSQL, |
||
| 88 | DatabaseConfigurationInterface::TYPE_REDIS |
||
| 89 | ); |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Mapping for boolean values passed on the console. |
||
| 93 | * |
||
| 94 | * @var array |
||
| 95 | * @Exclude |
||
| 96 | */ |
||
| 97 | protected $booleanMapping = array( |
||
| 98 | 'true' => true, |
||
| 99 | 'false' => false, |
||
| 100 | '1' => true, |
||
| 101 | '0' => false, |
||
| 102 | 'on' => true, |
||
| 103 | 'off' => false |
||
| 104 | ); |
||
| 105 | |||
| 106 | /** |
||
| 107 | * The serial that will be passed as commandline option (can not be specified in configuration file). |
||
| 108 | * |
||
| 109 | * @var string |
||
| 110 | * @Exclude |
||
| 111 | */ |
||
| 112 | protected $serial; |
||
| 113 | |||
| 114 | /** |
||
| 115 | * The application's unique DI identifier. |
||
| 116 | * |
||
| 117 | * @var string |
||
| 118 | * @Type("string") |
||
| 119 | * @SerializedName("id") |
||
| 120 | */ |
||
| 121 | protected $id; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * The system name to use. |
||
| 125 | * |
||
| 126 | * @var string |
||
| 127 | * @Type("string") |
||
| 128 | * @SerializedName("system-name") |
||
| 129 | */ |
||
| 130 | protected $systemName; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * The operation name to use. |
||
| 134 | * |
||
| 135 | * @var string |
||
| 136 | * @Type("string") |
||
| 137 | * @SerializedName("operation-name") |
||
| 138 | */ |
||
| 139 | protected $operationName; |
||
| 140 | |||
| 141 | /** |
||
| 142 | * The entity type code to use. |
||
| 143 | * |
||
| 144 | * @var string |
||
| 145 | * @Type("string") |
||
| 146 | * @SerializedName("entity-type-code") |
||
| 147 | */ |
||
| 148 | protected $entityTypeCode; |
||
| 149 | |||
| 150 | /** |
||
| 151 | * The Magento installation directory. |
||
| 152 | * |
||
| 153 | * @var string |
||
| 154 | * @Type("string") |
||
| 155 | * @SerializedName("installation-dir") |
||
| 156 | */ |
||
| 157 | protected $installationDir; |
||
| 158 | |||
| 159 | /** |
||
| 160 | * The source directory that has to be watched for new files. |
||
| 161 | * |
||
| 162 | * @var string |
||
| 163 | * @Type("string") |
||
| 164 | * @SerializedName("source-dir") |
||
| 165 | */ |
||
| 166 | protected $sourceDir; |
||
| 167 | |||
| 168 | /** |
||
| 169 | * The target directory with the files that has been imported. |
||
| 170 | * |
||
| 171 | * @var string |
||
| 172 | * @Type("string") |
||
| 173 | * @SerializedName("target-dir") |
||
| 174 | */ |
||
| 175 | protected $targetDir; |
||
| 176 | |||
| 177 | /** |
||
| 178 | * The Magento edition, EE or CE. |
||
| 179 | * |
||
| 180 | * @var string |
||
| 181 | * @Type("string") |
||
| 182 | * @SerializedName("magento-edition") |
||
| 183 | */ |
||
| 184 | protected $magentoEdition = 'CE'; |
||
| 185 | |||
| 186 | /** |
||
| 187 | * The Magento version, e. g. 2.1.0. |
||
| 188 | * |
||
| 189 | * @var string |
||
| 190 | * @Type("string") |
||
| 191 | * @SerializedName("magento-version") |
||
| 192 | */ |
||
| 193 | protected $magentoVersion = '2.1.2'; |
||
| 194 | |||
| 195 | /** |
||
| 196 | * ArrayCollection with the information of the configured databases. |
||
| 197 | * |
||
| 198 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 199 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Database>") |
||
| 200 | */ |
||
| 201 | protected $databases; |
||
| 202 | |||
| 203 | /** |
||
| 204 | * ArrayCollection with the information of the configured loggers. |
||
| 205 | * |
||
| 206 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 207 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Logger>") |
||
| 208 | */ |
||
| 209 | protected $loggers; |
||
| 210 | |||
| 211 | /** |
||
| 212 | * ArrayCollection with the information of the configured operations. |
||
| 213 | * |
||
| 214 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 215 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Operation>") |
||
| 216 | */ |
||
| 217 | protected $operations; |
||
| 218 | |||
| 219 | /** |
||
| 220 | * The subject's multiple field delimiter character for fields with multiple values, defaults to (,). |
||
| 221 | * |
||
| 222 | * @var string |
||
| 223 | * @Type("string") |
||
| 224 | * @SerializedName("multiple-field-delimiter") |
||
| 225 | */ |
||
| 226 | protected $multipleFieldDelimiter = ','; |
||
| 227 | |||
| 228 | /** |
||
| 229 | * The subject's multiple value delimiter character for fields with multiple values, defaults to (|). |
||
| 230 | * |
||
| 231 | * @var string |
||
| 232 | * @Type("string") |
||
| 233 | * @SerializedName("multiple-value-delimiter") |
||
| 234 | */ |
||
| 235 | protected $multipleValueDelimiter = '|'; |
||
| 236 | |||
| 237 | /** |
||
| 238 | * The flag to signal that the subject has to use the strict mode or not. |
||
| 239 | * |
||
| 240 | * @var boolean |
||
| 241 | * @Type("boolean") |
||
| 242 | * @SerializedName("strict-mode") |
||
| 243 | */ |
||
| 244 | protected $strictMode; |
||
| 245 | |||
| 246 | /** |
||
| 247 | * The flag whether or not the import artefacts have to be archived. |
||
| 248 | * |
||
| 249 | * @var boolean |
||
| 250 | * @Type("boolean") |
||
| 251 | * @SerializedName("archive-artefacts") |
||
| 252 | */ |
||
| 253 | protected $archiveArtefacts; |
||
| 254 | |||
| 255 | /** |
||
| 256 | * The directory where the archives will be stored. |
||
| 257 | * |
||
| 258 | * @var string |
||
| 259 | * @Type("string") |
||
| 260 | * @SerializedName("archive-dir") |
||
| 261 | */ |
||
| 262 | protected $archiveDir; |
||
| 263 | |||
| 264 | /** |
||
| 265 | * The flag to signal that the subject has to use the debug mode or not. |
||
| 266 | * |
||
| 267 | * @var boolean |
||
| 268 | * @Type("boolean") |
||
| 269 | * @SerializedName("debug-mode") |
||
| 270 | */ |
||
| 271 | protected $debugMode = false; |
||
| 272 | |||
| 273 | /** |
||
| 274 | * The log level to use (see Monolog documentation). |
||
| 275 | * |
||
| 276 | * @var string |
||
| 277 | * @Type("string") |
||
| 278 | * @SerializedName("log-level") |
||
| 279 | */ |
||
| 280 | protected $logLevel = LogLevel::INFO; |
||
| 281 | |||
| 282 | /** |
||
| 283 | * The explicit DB ID to use. |
||
| 284 | * |
||
| 285 | * @var string |
||
| 286 | * @Type("string") |
||
| 287 | * @SerializedName("use-db-id") |
||
| 288 | */ |
||
| 289 | protected $useDbId; |
||
| 290 | |||
| 291 | /** |
||
| 292 | * The explicit PID filename to use. |
||
| 293 | * |
||
| 294 | * @var string |
||
| 295 | * @Type("string") |
||
| 296 | * @SerializedName("pid-filename") |
||
| 297 | */ |
||
| 298 | protected $pidFilename; |
||
| 299 | |||
| 300 | /** |
||
| 301 | * The collection with the paths to additional vendor directories. |
||
| 302 | * |
||
| 303 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 304 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\VendorDir>") |
||
| 305 | * @SerializedName("additional-vendor-dirs") |
||
| 306 | */ |
||
| 307 | protected $additionalVendorDirs; |
||
| 308 | |||
| 309 | /** |
||
| 310 | * The array with the Magento Edition specific extension libraries. |
||
| 311 | * |
||
| 312 | * @var array |
||
| 313 | * @Type("array") |
||
| 314 | * @SerializedName("extension-libraries") |
||
| 315 | */ |
||
| 316 | protected $extensionLibraries = array(); |
||
| 317 | |||
| 318 | /** |
||
| 319 | * The array with the custom header mappings. |
||
| 320 | * |
||
| 321 | * @var array |
||
| 322 | * @Type("array") |
||
| 323 | * @SerializedName("header-mappings") |
||
| 324 | */ |
||
| 325 | protected $headerMappings = array(); |
||
| 326 | |||
| 327 | /** |
||
| 328 | * The array with the custom image types. |
||
| 329 | * |
||
| 330 | * @var array |
||
| 331 | * @Type("array") |
||
| 332 | * @SerializedName("image-types") |
||
| 333 | */ |
||
| 334 | protected $imageTypes = array(); |
||
| 335 | |||
| 336 | /** |
||
| 337 | * The flag to signal that the import should be wrapped within a single transation or not. |
||
| 338 | * |
||
| 339 | * @var boolean |
||
| 340 | * @Type("boolean") |
||
| 341 | * @SerializedName("single-transaction") |
||
| 342 | */ |
||
| 343 | protected $singleTransaction = false; |
||
| 344 | |||
| 345 | /** |
||
| 346 | * The flag to signal that the cache should be enabled or not. |
||
| 347 | * |
||
| 348 | * @var boolean |
||
| 349 | * @Type("boolean") |
||
| 350 | * @SerializedName("cache-enabled") |
||
| 351 | */ |
||
| 352 | protected $cacheEnabled = true; |
||
| 353 | |||
| 354 | /** |
||
| 355 | * ArrayCollection with the information of the configured aliases. |
||
| 356 | * |
||
| 357 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 358 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Alias>") |
||
| 359 | */ |
||
| 360 | protected $aliases; |
||
| 361 | |||
| 362 | /** |
||
| 363 | * ArrayCollection with the information of the configured caches. |
||
| 364 | * |
||
| 365 | * @var \Doctrine\Common\Collections\ArrayCollection |
||
| 366 | * @Type("ArrayCollection<TechDivision\Import\Configuration\Jms\Configuration\Cache>") |
||
| 367 | */ |
||
| 368 | protected $caches; |
||
| 369 | |||
| 370 | /** |
||
| 371 | * Return's the array with the plugins of the operation to use. |
||
| 372 | * |
||
| 373 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the plugins |
||
| 374 | * @throws \Exception Is thrown, if no plugins are available for the actual operation |
||
| 375 | */ |
||
| 376 | public function getPlugins() |
||
| 390 | |||
| 391 | /** |
||
| 392 | * Map's the passed value to a boolean. |
||
| 393 | * |
||
| 394 | * @param string $value The value to map |
||
| 395 | * |
||
| 396 | * @return boolean The mapped value |
||
| 397 | * @throws \Exception Is thrown, if the value can't be mapped |
||
| 398 | */ |
||
| 399 | public function mapBoolean($value) |
||
| 410 | |||
| 411 | /** |
||
| 412 | * Return's the operation, initialize from the actual operation name. |
||
| 413 | * |
||
| 414 | * @return \TechDivision\Import\Configuration\OperationConfigurationInterface The operation instance |
||
| 415 | */ |
||
| 416 | public function getOperation() |
||
| 420 | |||
| 421 | /** |
||
| 422 | * Return's the application's unique DI identifier. |
||
| 423 | * |
||
| 424 | * @return string The application's unique DI identifier |
||
| 425 | */ |
||
| 426 | public function getId() |
||
| 430 | |||
| 431 | /** |
||
| 432 | * Return's the operation name that has to be used. |
||
| 433 | * |
||
| 434 | * @param string $operationName The operation name that has to be used |
||
| 435 | * |
||
| 436 | * @return void |
||
| 437 | */ |
||
| 438 | public function setOperationName($operationName) |
||
| 442 | |||
| 443 | /** |
||
| 444 | * Return's the operation name that has to be used. |
||
| 445 | * |
||
| 446 | * @return string The operation name that has to be used |
||
| 447 | */ |
||
| 448 | public function getOperationName() |
||
| 452 | |||
| 453 | /** |
||
| 454 | * Set's the Magento installation directory. |
||
| 455 | * |
||
| 456 | * @param string $installationDir The Magento installation directory |
||
| 457 | * |
||
| 458 | * @return void |
||
| 459 | */ |
||
| 460 | public function setInstallationDir($installationDir) |
||
| 464 | |||
| 465 | /** |
||
| 466 | * Return's the Magento installation directory. |
||
| 467 | * |
||
| 468 | * @return string The Magento installation directory |
||
| 469 | */ |
||
| 470 | public function getInstallationDir() |
||
| 474 | |||
| 475 | /** |
||
| 476 | * Set's the source directory that has to be watched for new files. |
||
| 477 | * |
||
| 478 | * @param string $sourceDir The source directory |
||
| 479 | * |
||
| 480 | * @return void |
||
| 481 | */ |
||
| 482 | public function setSourceDir($sourceDir) |
||
| 486 | |||
| 487 | /** |
||
| 488 | * Return's the source directory that has to be watched for new files. |
||
| 489 | * |
||
| 490 | * @return string The source directory |
||
| 491 | */ |
||
| 492 | public function getSourceDir() |
||
| 496 | |||
| 497 | /** |
||
| 498 | * Set's the target directory with the files that has been imported. |
||
| 499 | * |
||
| 500 | * @param string $targetDir The target directory |
||
| 501 | * |
||
| 502 | * @return void |
||
| 503 | */ |
||
| 504 | public function setTargetDir($targetDir) |
||
| 508 | |||
| 509 | /** |
||
| 510 | * Return's the target directory with the files that has been imported. |
||
| 511 | * |
||
| 512 | * @return string The target directory |
||
| 513 | */ |
||
| 514 | public function getTargetDir() |
||
| 518 | |||
| 519 | /** |
||
| 520 | * Set's the Magento edition, EE or CE. |
||
| 521 | * |
||
| 522 | * @param string $magentoEdition The Magento edition |
||
| 523 | * |
||
| 524 | * @return void |
||
| 525 | */ |
||
| 526 | public function setMagentoEdition($magentoEdition) |
||
| 530 | |||
| 531 | /** |
||
| 532 | * Return's the Magento edition, EE or CE. |
||
| 533 | * |
||
| 534 | * @return string The Magento edition |
||
| 535 | */ |
||
| 536 | public function getMagentoEdition() |
||
| 540 | |||
| 541 | /** |
||
| 542 | * Return's the Magento version, e. g. 2.1.0. |
||
| 543 | * |
||
| 544 | * @param string $magentoVersion The Magento version |
||
| 545 | * |
||
| 546 | * @return void |
||
| 547 | */ |
||
| 548 | public function setMagentoVersion($magentoVersion) |
||
| 552 | |||
| 553 | /** |
||
| 554 | * Return's the Magento version, e. g. 2.1.0. |
||
| 555 | * |
||
| 556 | * @return string The Magento version |
||
| 557 | */ |
||
| 558 | public function getMagentoVersion() |
||
| 562 | |||
| 563 | /** |
||
| 564 | * Set's the subject's source date format to use. |
||
| 565 | * |
||
| 566 | * @param string $sourceDateFormat The source date format |
||
| 567 | * |
||
| 568 | * @return void |
||
| 569 | */ |
||
| 570 | public function setSourceDateFormat($sourceDateFormat) |
||
| 574 | |||
| 575 | /** |
||
| 576 | * Return's the entity type code to be used. |
||
| 577 | * |
||
| 578 | * @return string The entity type code to be used |
||
| 579 | */ |
||
| 580 | public function getEntityTypeCode() |
||
| 584 | |||
| 585 | /** |
||
| 586 | * Set's the entity type code to be used. |
||
| 587 | * |
||
| 588 | * @param string $entityTypeCode The entity type code |
||
| 589 | * |
||
| 590 | * @return void |
||
| 591 | */ |
||
| 592 | public function setEntityTypeCode($entityTypeCode) |
||
| 596 | |||
| 597 | /** |
||
| 598 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
| 599 | * |
||
| 600 | * @return string The multiple field delimiter character |
||
| 601 | */ |
||
| 602 | public function getMultipleFieldDelimiter() |
||
| 606 | |||
| 607 | /** |
||
| 608 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
| 609 | * |
||
| 610 | * @return string The multiple value delimiter character |
||
| 611 | */ |
||
| 612 | public function getMultipleValueDelimiter() |
||
| 616 | |||
| 617 | /** |
||
| 618 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
| 619 | * |
||
| 620 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
| 621 | */ |
||
| 622 | public function isStrictMode() |
||
| 626 | |||
| 627 | /** |
||
| 628 | * Remove's all configured database configuration. |
||
| 629 | * |
||
| 630 | * @return void |
||
| 631 | */ |
||
| 632 | public function clearDatabases() |
||
| 636 | |||
| 637 | /** |
||
| 638 | * Add's the passed database configuration. |
||
| 639 | * |
||
| 640 | * @param \TechDivision\Import\Configuration\DatabaseConfigurationInterface $database The database configuration |
||
| 641 | * |
||
| 642 | * @return void |
||
| 643 | */ |
||
| 644 | public function addDatabase(DatabaseConfigurationInterface $database) |
||
| 648 | |||
| 649 | /** |
||
| 650 | * Return's the number database configurations. |
||
| 651 | * |
||
| 652 | * @return integer The number of database configurations |
||
| 653 | */ |
||
| 654 | public function countDatabases() |
||
| 658 | |||
| 659 | /** |
||
| 660 | * Return's the database configuration with the passed ID. |
||
| 661 | * |
||
| 662 | * @param string $id The ID of the database connection to return |
||
| 663 | * |
||
| 664 | * @return \TechDivision\Import\Configuration\DatabaseConfigurationInterface The database configuration |
||
| 665 | * @throws \Exception Is thrown, if no database configuration is available |
||
| 666 | */ |
||
| 667 | public function getDatabaseById($id) |
||
| 681 | |||
| 682 | /** |
||
| 683 | * Return's the databases for the given type. |
||
| 684 | * |
||
| 685 | * @param string $type The database type to return the configurations for |
||
| 686 | * |
||
| 687 | * @return \Doctrine\Common\Collections\Collection The collection with the database configurations |
||
| 688 | */ |
||
| 689 | public function getDatabasesByType($type) |
||
| 706 | |||
| 707 | /** |
||
| 708 | * Query's whether or not the passed database configuration has a valid type. |
||
| 709 | * |
||
| 710 | * @return boolean TRUE if the passed database configuration has a valid type, else FALSE |
||
| 711 | */ |
||
| 712 | protected function isValidDatabaseType(DatabaseConfigurationInterface $database) |
||
| 716 | |||
| 717 | /** |
||
| 718 | * Return's the database configuration. |
||
| 719 | * |
||
| 720 | * If an explicit DB ID is specified, the method tries to return the database with this ID. If |
||
| 721 | * the database configuration is NOT available, an execption is thrown. |
||
| 722 | * |
||
| 723 | * If no explicit DB ID is specified, the method tries to return the default database configuration, |
||
| 724 | * if not available the first one. |
||
| 725 | * |
||
| 726 | * @return \TechDivision\Import\Configuration\DatabaseConfigurationInterface The database configuration |
||
| 727 | * @throws \Exception Is thrown, if no database configuration is available |
||
| 728 | */ |
||
| 729 | public function getDatabase() |
||
| 753 | |||
| 754 | /** |
||
| 755 | * Return's the ArrayCollection with the configured operations. |
||
| 756 | * |
||
| 757 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the operations |
||
| 758 | */ |
||
| 759 | public function getOperations() |
||
| 763 | |||
| 764 | /** |
||
| 765 | * Return's the ArrayCollection with the configured loggers. |
||
| 766 | * |
||
| 767 | * @return \Doctrine\Common\Collections\ArrayCollection The ArrayCollection with the loggers |
||
| 768 | */ |
||
| 769 | public function getLoggers() |
||
| 773 | |||
| 774 | /** |
||
| 775 | * Set's the flag that import artefacts have to be archived or not. |
||
| 776 | * |
||
| 777 | * @param boolean $archiveArtefacts TRUE if artefacts have to be archived, else FALSE |
||
| 778 | * |
||
| 779 | * @return void |
||
| 780 | */ |
||
| 781 | public function setArchiveArtefacts($archiveArtefacts) |
||
| 785 | |||
| 786 | /** |
||
| 787 | * Return's the TRUE if the import artefacts have to be archived. |
||
| 788 | * |
||
| 789 | * @return boolean TRUE if the import artefacts have to be archived |
||
| 790 | */ |
||
| 791 | public function haveArchiveArtefacts() |
||
| 795 | |||
| 796 | /** |
||
| 797 | * The directory where the archives will be stored. |
||
| 798 | * |
||
| 799 | * @param string $archiveDir The archive directory |
||
| 800 | * |
||
| 801 | * @return void |
||
| 802 | */ |
||
| 803 | public function setArchiveDir($archiveDir) |
||
| 807 | |||
| 808 | /** |
||
| 809 | * The directory where the archives will be stored. |
||
| 810 | * |
||
| 811 | * @return string The archive directory |
||
| 812 | */ |
||
| 813 | public function getArchiveDir() |
||
| 817 | |||
| 818 | /** |
||
| 819 | * Set's the debug mode. |
||
| 820 | * |
||
| 821 | * @param boolean $debugMode TRUE if debug mode is enabled, else FALSE |
||
| 822 | * |
||
| 823 | * @return void |
||
| 824 | */ |
||
| 825 | public function setDebugMode($debugMode) |
||
| 829 | |||
| 830 | /** |
||
| 831 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
| 832 | * |
||
| 833 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
| 834 | */ |
||
| 835 | public function isDebugMode() |
||
| 839 | |||
| 840 | /** |
||
| 841 | * Set's the log level to use. |
||
| 842 | * |
||
| 843 | * @param string $logLevel The log level to use |
||
| 844 | * |
||
| 845 | * @return void |
||
| 846 | */ |
||
| 847 | public function setLogLevel($logLevel) |
||
| 851 | |||
| 852 | /** |
||
| 853 | * Return's the log level to use. |
||
| 854 | * |
||
| 855 | * @return string The log level to use |
||
| 856 | */ |
||
| 857 | public function getLogLevel() |
||
| 861 | |||
| 862 | /** |
||
| 863 | * Set's the explicit DB ID to use. |
||
| 864 | * |
||
| 865 | * @param string $useDbId The explicit DB ID to use |
||
| 866 | * |
||
| 867 | * @return void |
||
| 868 | */ |
||
| 869 | public function setUseDbId($useDbId) |
||
| 873 | |||
| 874 | /** |
||
| 875 | * Return's the explicit DB ID to use. |
||
| 876 | * |
||
| 877 | * @return string The explicit DB ID to use |
||
| 878 | */ |
||
| 879 | public function getUseDbId() |
||
| 883 | |||
| 884 | /** |
||
| 885 | * Set's the PID filename to use. |
||
| 886 | * |
||
| 887 | * @param string $pidFilename The PID filename to use |
||
| 888 | * |
||
| 889 | * @return void |
||
| 890 | */ |
||
| 891 | public function setPidFilename($pidFilename) |
||
| 895 | |||
| 896 | /** |
||
| 897 | * Return's the PID filename to use. |
||
| 898 | * |
||
| 899 | * @return string The PID filename to use |
||
| 900 | */ |
||
| 901 | public function getPidFilename() |
||
| 905 | |||
| 906 | /** |
||
| 907 | * Set's the systemm name to be used. |
||
| 908 | * |
||
| 909 | * @param string $systemName The system name to be used |
||
| 910 | * |
||
| 911 | * @return void |
||
| 912 | */ |
||
| 913 | public function setSystemName($systemName) |
||
| 917 | |||
| 918 | /** |
||
| 919 | * Return's the systemm name to be used. |
||
| 920 | * |
||
| 921 | * @return string The system name to be used |
||
| 922 | */ |
||
| 923 | public function getSystemName() |
||
| 927 | |||
| 928 | /** |
||
| 929 | * Set's the collection with the path of the Magento Edition specific extension libraries. |
||
| 930 | * |
||
| 931 | * @param array $extensionLibraries The paths of the Magento Edition specific extension libraries |
||
| 932 | * |
||
| 933 | * @return void |
||
| 934 | */ |
||
| 935 | public function setExtensionLibraries(array $extensionLibraries) |
||
| 939 | |||
| 940 | /** |
||
| 941 | * Return's an array with the path of the Magento Edition specific extension libraries. |
||
| 942 | * |
||
| 943 | * @return array The paths of the Magento Edition specific extension libraries |
||
| 944 | */ |
||
| 945 | public function getExtensionLibraries() |
||
| 949 | |||
| 950 | /** |
||
| 951 | * Return's a collection with the path to additional vendor directories. |
||
| 952 | * |
||
| 953 | * @return \Doctrine\Common\Collections\ArrayCollection The paths to additional vendor directories |
||
| 954 | */ |
||
| 955 | public function getAdditionalVendorDirs() |
||
| 959 | |||
| 960 | /** |
||
| 961 | * Lifecycle callback that will be invoked after deserialization. |
||
| 962 | * |
||
| 963 | * @return void |
||
| 964 | * @PostDeserialize |
||
| 965 | */ |
||
| 966 | public function postDeserialize() |
||
| 994 | |||
| 995 | /** |
||
| 996 | * The array with the subject's custom header mappings. |
||
| 997 | * |
||
| 998 | * @return array The custom header mappings |
||
| 999 | */ |
||
| 1000 | public function getHeaderMappings() |
||
| 1014 | |||
| 1015 | /** |
||
| 1016 | * The array with the subject's custom image types. |
||
| 1017 | * |
||
| 1018 | * @return array The custom image types |
||
| 1019 | */ |
||
| 1020 | public function getImageTypes() |
||
| 1034 | |||
| 1035 | /** |
||
| 1036 | * Set's the flag that decides whether or not the import should be wrapped within a single transaction. |
||
| 1037 | * |
||
| 1038 | * @param boolean $singleTransaction TRUE if the import should be wrapped in a single transation, else FALSE |
||
| 1039 | * |
||
| 1040 | * @return void |
||
| 1041 | */ |
||
| 1042 | public function setSingleTransaction($singleTransaction) |
||
| 1046 | |||
| 1047 | /** |
||
| 1048 | * Whether or not the import should be wrapped within a single transation. |
||
| 1049 | * |
||
| 1050 | * @return boolean TRUE if the import should be wrapped in a single transation, else FALSE |
||
| 1051 | */ |
||
| 1052 | public function isSingleTransaction() |
||
| 1056 | |||
| 1057 | /** |
||
| 1058 | * Set's the flag that decides whether or not the the cache has been enabled. |
||
| 1059 | * |
||
| 1060 | * @param boolean $cacheEnabled TRUE if the cache has been enabled, else FALSE |
||
| 1061 | * |
||
| 1062 | * @return void |
||
| 1063 | */ |
||
| 1064 | public function setCacheEnabled($cacheEnabled) |
||
| 1068 | |||
| 1069 | /** |
||
| 1070 | * Whether or not the cache functionality should be enabled. |
||
| 1071 | * |
||
| 1072 | * @return boolean TRUE if the cache has to be enabled, else FALSE |
||
| 1073 | */ |
||
| 1074 | public function isCacheEnabled() |
||
| 1078 | |||
| 1079 | /** |
||
| 1080 | * Set's the passed serial from the commandline to the configuration. |
||
| 1081 | * |
||
| 1082 | * @param string $serial The serial from the commandline |
||
| 1083 | */ |
||
| 1084 | public function setSerial($serial) |
||
| 1088 | |||
| 1089 | /** |
||
| 1090 | * Return's the serial from the commandline. |
||
| 1091 | * |
||
| 1092 | * @return string The serial |
||
| 1093 | */ |
||
| 1094 | public function getSerial() |
||
| 1098 | |||
| 1099 | /** |
||
| 1100 | * Return's the configuration for the caches. |
||
| 1101 | * |
||
| 1102 | * @return \Doctrine\Common\Collections\ArrayCollection The cache configurations |
||
| 1103 | */ |
||
| 1104 | public function getCaches() |
||
| 1115 | |||
| 1116 | /** |
||
| 1117 | * Return's the cache configuration for the passed type. |
||
| 1118 | * |
||
| 1119 | * @param string $type The cache type to return the configuation for |
||
| 1120 | * |
||
| 1121 | * @return \TechDivision\Import\Configuration\CacheConfigurationInterface The cache configuration |
||
| 1122 | */ |
||
| 1123 | public function getCacheByType($type) |
||
| 1137 | |||
| 1138 | /** |
||
| 1139 | * Return's the alias configuration. |
||
| 1140 | * |
||
| 1141 | * @return \Doctrine\Common\Collections\ArrayCollection The alias configuration |
||
| 1142 | */ |
||
| 1143 | public function getAliases() |
||
| 1147 | } |
||
| 1148 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: