SchemaConfig.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. /*
  3. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  4. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  5. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  6. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  7. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  8. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  9. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  11. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  12. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. *
  15. * This software consists of voluntary contributions made by many individuals
  16. * and is licensed under the LGPL. For more information, see
  17. * <http://www.doctrine-project.org>.
  18. */
  19. namespace Doctrine\DBAL\Schema;
  20. /**
  21. * Configuration for a Schema
  22. *
  23. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  24. * @link www.doctrine-project.org
  25. * @since 2.0
  26. * @author Benjamin Eberlei <kontakt@beberlei.de>
  27. */
  28. class SchemaConfig
  29. {
  30. /**
  31. * @var bool
  32. */
  33. protected $_hasExplicitForeignKeyIndexes = false;
  34. /**
  35. * @var int
  36. */
  37. protected $_maxIdentifierLength = 63;
  38. /**
  39. * @var string
  40. */
  41. protected $_name;
  42. /**
  43. * @return bool
  44. */
  45. public function hasExplicitForeignKeyIndexes()
  46. {
  47. return $this->_hasExplicitForeignKeyIndexes;
  48. }
  49. /**
  50. * @param bool $flag
  51. */
  52. public function setExplicitForeignKeyIndexes($flag)
  53. {
  54. $this->_hasExplicitForeignKeyIndexes = (bool)$flag;
  55. }
  56. /**
  57. * @param int $length
  58. */
  59. public function setMaxIdentifierLength($length)
  60. {
  61. $this->_maxIdentifierLength = (int)$length;
  62. }
  63. /**
  64. * @return int
  65. */
  66. public function getMaxIdentifierLength()
  67. {
  68. return $this->_maxIdentifierLength;
  69. }
  70. /**
  71. * Get default namespace of schema objects.
  72. *
  73. * @return string
  74. */
  75. public function getName()
  76. {
  77. return $this->_name;
  78. }
  79. /**
  80. * set default namespace name of schema objects.
  81. *
  82. * @param _name the value to set.
  83. */
  84. public function setName($name)
  85. {
  86. $this->_name = $name;
  87. }
  88. }