SchemaDropTableEventArgs.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace Doctrine\DBAL\Event;
  3. use Doctrine\DBAL\Platforms\AbstractPlatform;
  4. use Doctrine\DBAL\Schema\Table;
  5. use InvalidArgumentException;
  6. /**
  7. * Event Arguments used when the SQL query for dropping tables are generated inside {@link AbstractPlatform}.
  8. */
  9. class SchemaDropTableEventArgs extends SchemaEventArgs
  10. {
  11. /** @var string|Table */
  12. private $table;
  13. /** @var AbstractPlatform */
  14. private $platform;
  15. /** @var string|null */
  16. private $sql;
  17. /**
  18. * @param string|Table $table
  19. *
  20. * @throws InvalidArgumentException
  21. */
  22. public function __construct($table, AbstractPlatform $platform)
  23. {
  24. $this->table = $table;
  25. $this->platform = $platform;
  26. }
  27. /**
  28. * @return string|Table
  29. */
  30. public function getTable()
  31. {
  32. return $this->table;
  33. }
  34. /**
  35. * @return AbstractPlatform
  36. */
  37. public function getPlatform()
  38. {
  39. return $this->platform;
  40. }
  41. /**
  42. * @param string $sql
  43. *
  44. * @return SchemaDropTableEventArgs
  45. */
  46. public function setSql($sql)
  47. {
  48. $this->sql = $sql;
  49. return $this;
  50. }
  51. /**
  52. * @return string|null
  53. */
  54. public function getSql()
  55. {
  56. return $this->sql;
  57. }
  58. }