MigrationsEventArgs.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\Migrations\Event;
  4. use Doctrine\Common\EventArgs;
  5. use Doctrine\DBAL\Connection;
  6. use Doctrine\Migrations\Metadata\MigrationPlanList;
  7. use Doctrine\Migrations\MigratorConfiguration;
  8. /**
  9. * The MigrationEventsArgs class is passed to events not related to a single migration version.
  10. */
  11. final class MigrationsEventArgs extends EventArgs
  12. {
  13. /** @var Connection */
  14. private $connection;
  15. /** @var MigrationPlanList */
  16. private $plan;
  17. /** @var MigratorConfiguration */
  18. private $migratorConfiguration;
  19. public function __construct(
  20. Connection $connection,
  21. MigrationPlanList $plan,
  22. MigratorConfiguration $migratorConfiguration
  23. ) {
  24. $this->connection = $connection;
  25. $this->plan = $plan;
  26. $this->migratorConfiguration = $migratorConfiguration;
  27. }
  28. public function getConnection(): Connection
  29. {
  30. return $this->connection;
  31. }
  32. public function getPlan(): MigrationPlanList
  33. {
  34. return $this->plan;
  35. }
  36. public function getMigratorConfiguration(): MigratorConfiguration
  37. {
  38. return $this->migratorConfiguration;
  39. }
  40. }