SetupInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Setup;
  7. /**
  8. * DB resource interface
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface SetupInterface
  14. {
  15. /**
  16. * Gets connection object
  17. *
  18. * @return \Magento\Framework\DB\Adapter\AdapterInterface
  19. */
  20. public function getConnection();
  21. /**
  22. * Adds table placeholder/table name relation
  23. *
  24. * @param string $tableName
  25. * @param string $realTableName
  26. * @return $this
  27. */
  28. public function setTable($tableName, $realTableName);
  29. /**
  30. * Gets table name (validated by db adapter) by table placeholder
  31. *
  32. * @param string|array $tableName
  33. * @return string
  34. */
  35. public function getTable($tableName);
  36. /**
  37. * Gets table placeholder by table name
  38. *
  39. * @param string $tableName
  40. * @return string
  41. * @since 100.1.0
  42. */
  43. public function getTablePlaceholder($tableName);
  44. /**
  45. * Checks if table exists
  46. *
  47. * @param string $table
  48. * @return bool
  49. */
  50. public function tableExists($table);
  51. /**
  52. * Runs plain SQL query(ies)
  53. *
  54. * @param string $sql
  55. * @return $this
  56. */
  57. public function run($sql);
  58. /**
  59. * Prepares database before install/upgrade
  60. *
  61. * @return $this
  62. */
  63. public function startSetup();
  64. /**
  65. * Prepares database after install/upgrade
  66. *
  67. * @return $this
  68. */
  69. public function endSetup();
  70. }