SchemaConfig.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. namespace Doctrine\DBAL\Schema;
  3. /**
  4. * Configuration for a Schema.
  5. */
  6. class SchemaConfig
  7. {
  8. /** @var bool */
  9. protected $hasExplicitForeignKeyIndexes = false;
  10. /** @var int */
  11. protected $maxIdentifierLength = 63;
  12. /** @var string */
  13. protected $name;
  14. /** @var mixed[] */
  15. protected $defaultTableOptions = [];
  16. /**
  17. * @return bool
  18. */
  19. public function hasExplicitForeignKeyIndexes()
  20. {
  21. return $this->hasExplicitForeignKeyIndexes;
  22. }
  23. /**
  24. * @param bool $flag
  25. *
  26. * @return void
  27. */
  28. public function setExplicitForeignKeyIndexes($flag)
  29. {
  30. $this->hasExplicitForeignKeyIndexes = (bool) $flag;
  31. }
  32. /**
  33. * @param int $length
  34. *
  35. * @return void
  36. */
  37. public function setMaxIdentifierLength($length)
  38. {
  39. $this->maxIdentifierLength = (int) $length;
  40. }
  41. /**
  42. * @return int
  43. */
  44. public function getMaxIdentifierLength()
  45. {
  46. return $this->maxIdentifierLength;
  47. }
  48. /**
  49. * Gets the default namespace of schema objects.
  50. *
  51. * @return string
  52. */
  53. public function getName()
  54. {
  55. return $this->name;
  56. }
  57. /**
  58. * Sets the default namespace name of schema objects.
  59. *
  60. * @param string $name The value to set.
  61. *
  62. * @return void
  63. */
  64. public function setName($name)
  65. {
  66. $this->name = $name;
  67. }
  68. /**
  69. * Gets the default options that are passed to Table instances created with
  70. * Schema#createTable().
  71. *
  72. * @return mixed[]
  73. */
  74. public function getDefaultTableOptions()
  75. {
  76. return $this->defaultTableOptions;
  77. }
  78. /**
  79. * @param mixed[] $defaultTableOptions
  80. *
  81. * @return void
  82. */
  83. public function setDefaultTableOptions(array $defaultTableOptions)
  84. {
  85. $this->defaultTableOptions = $defaultTableOptions;
  86. }
  87. }