You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.1 KiB

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