DatabasePlatformMock.php 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. }