DatabasePlatformMock.php 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. }
  69. }