ISchemaWrapper.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OCP\DB;
  22. /**
  23. * Interface ISchemaWrapper
  24. *
  25. * @package OCP\DB
  26. * @since 13.0.0
  27. */
  28. interface ISchemaWrapper {
  29. /**
  30. * @param string $tableName
  31. *
  32. * @return \Doctrine\DBAL\Schema\Table
  33. * @throws \Doctrine\DBAL\Schema\SchemaException
  34. * @since 13.0.0
  35. */
  36. public function getTable($tableName);
  37. /**
  38. * Does this schema have a table with the given name?
  39. *
  40. * @param string $tableName Prefix is automatically prepended
  41. *
  42. * @return boolean
  43. * @since 13.0.0
  44. */
  45. public function hasTable($tableName);
  46. /**
  47. * Creates a new table.
  48. *
  49. * @param string $tableName Prefix is automatically prepended
  50. * @return \Doctrine\DBAL\Schema\Table
  51. * @since 13.0.0
  52. */
  53. public function createTable($tableName);
  54. /**
  55. * Drops a table from the schema.
  56. *
  57. * @param string $tableName Prefix is automatically prepended
  58. * @return \Doctrine\DBAL\Schema\Schema
  59. * @since 13.0.0
  60. */
  61. public function dropTable($tableName);
  62. /**
  63. * Gets all tables of this schema.
  64. *
  65. * @return \Doctrine\DBAL\Schema\Table[]
  66. * @since 13.0.0
  67. */
  68. public function getTables();
  69. /**
  70. * Gets all table names, prefixed with table prefix
  71. *
  72. * @return array
  73. * @since 13.0.0
  74. */
  75. public function getTableNames();
  76. /**
  77. * Gets all table names
  78. *
  79. * @return array
  80. * @since 13.0.0
  81. */
  82. public function getTableNamesWithoutPrefix();
  83. }