DatabasePlatformMock.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. namespace Doctrine\Tests\Mocks;
  3. class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
  4. {
  5. private $_sequenceNextValSql = "";
  6. private $_prefersIdentityColumns = true;
  7. private $_prefersSequences = false;
  8. /**
  9. * @override
  10. */
  11. public function getNativeDeclaration(array $field) {}
  12. /**
  13. * @override
  14. */
  15. public function getPortableDeclaration(array $field) {}
  16. /**
  17. * @override
  18. */
  19. public function prefersIdentityColumns()
  20. {
  21. return $this->_prefersIdentityColumns;
  22. }
  23. /**
  24. * @override
  25. */
  26. public function prefersSequences()
  27. {
  28. return $this->_prefersSequences;
  29. }
  30. /** @override */
  31. public function getSequenceNextValSQL($sequenceName)
  32. {
  33. return $this->_sequenceNextValSql;
  34. }
  35. /** @override */
  36. public function getBooleanTypeDeclarationSQL(array $field) {}
  37. /** @override */
  38. public function getIntegerTypeDeclarationSQL(array $field) {}
  39. /** @override */
  40. public function getBigIntTypeDeclarationSQL(array $field) {}
  41. /** @override */
  42. public function getSmallIntTypeDeclarationSQL(array $field) {}
  43. /** @override */
  44. protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {}
  45. /** @override */
  46. public function getVarcharTypeDeclarationSQL(array $field) {}
  47. /** @override */
  48. public function getClobTypeDeclarationSQL(array $field) {}
  49. /* MOCK API */
  50. public function setPrefersIdentityColumns($bool)
  51. {
  52. $this->_prefersIdentityColumns = $bool;
  53. }
  54. public function setPrefersSequences($bool)
  55. {
  56. $this->_prefersSequences = $bool;
  57. }
  58. public function setSequenceNextValSql($sql)
  59. {
  60. $this->_sequenceNextValSql = $sql;
  61. }
  62. public function getName()
  63. {
  64. return 'mock';
  65. }
  66. protected function initializeDoctrineTypeMappings() {
  67. }
  68. protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed)
  69. {
  70. }
  71. /**
  72. * Gets the SQL Snippet used to declare a BLOB column type.
  73. */
  74. public function getBlobTypeDeclarationSQL(array $field)
  75. {
  76. throw DBALException::notSupported(__METHOD__);
  77. }
  78. }