MigratorConfiguration.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\Migrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. /**
  6. * The MigratorConfiguration class is responsible for defining the configuration for a migration.
  7. *
  8. * @internal
  9. *
  10. * @see Doctrine\Migrations\DbalMigrator
  11. * @see Doctrine\Migrations\Version\DbalExecutor
  12. */
  13. class MigratorConfiguration
  14. {
  15. /** @var bool */
  16. private $dryRun = false;
  17. /** @var bool */
  18. private $timeAllQueries = false;
  19. /** @var bool */
  20. private $noMigrationException = false;
  21. /** @var bool */
  22. private $allOrNothing = false;
  23. /** @var Schema|null */
  24. private $fromSchema;
  25. public function isDryRun(): bool
  26. {
  27. return $this->dryRun;
  28. }
  29. public function setDryRun(bool $dryRun): self
  30. {
  31. $this->dryRun = $dryRun;
  32. return $this;
  33. }
  34. public function getTimeAllQueries(): bool
  35. {
  36. return $this->timeAllQueries;
  37. }
  38. public function setTimeAllQueries(bool $timeAllQueries): self
  39. {
  40. $this->timeAllQueries = $timeAllQueries;
  41. return $this;
  42. }
  43. public function getNoMigrationException(): bool
  44. {
  45. return $this->noMigrationException;
  46. }
  47. public function setNoMigrationException(bool $noMigrationException = false): self
  48. {
  49. $this->noMigrationException = $noMigrationException;
  50. return $this;
  51. }
  52. public function isAllOrNothing(): bool
  53. {
  54. return $this->allOrNothing;
  55. }
  56. public function setAllOrNothing(bool $allOrNothing): self
  57. {
  58. $this->allOrNothing = $allOrNothing;
  59. return $this;
  60. }
  61. public function getFromSchema(): ?Schema
  62. {
  63. return $this->fromSchema;
  64. }
  65. public function setFromSchema(Schema $fromSchema): self
  66. {
  67. $this->fromSchema = $fromSchema;
  68. return $this;
  69. }
  70. }