ModuleDataSetupInterface.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 data resource interface for a module
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface ModuleDataSetupInterface extends SetupInterface
  14. {
  15. const DEFAULT_SETUP_CONNECTION = 'default_setup';
  16. const VERSION_COMPARE_EQUAL = 0;
  17. const VERSION_COMPARE_LOWER = -1;
  18. const VERSION_COMPARE_GREATER = 1;
  19. const TYPE_DATA_INSTALL = 'data-install';
  20. const TYPE_DATA_UPGRADE = 'data-upgrade';
  21. /**
  22. * Retrieve row or field from table by id or string and parent id
  23. *
  24. * @param string $table
  25. * @param string $idField
  26. * @param string|integer $rowId
  27. * @param string|null $field
  28. * @param string|null $parentField
  29. * @param string|integer $parentId
  30. * @return mixed
  31. */
  32. public function getTableRow($table, $idField, $rowId, $field = null, $parentField = null, $parentId = 0);
  33. /**
  34. * Delete table row
  35. *
  36. * @param string $table
  37. * @param string $idField
  38. * @param string|int $rowId
  39. * @param null|string $parentField
  40. * @param int|string $parentId
  41. * @return $this
  42. */
  43. public function deleteTableRow($table, $idField, $rowId, $parentField = null, $parentId = 0);
  44. /**
  45. * Update one or more fields of table row
  46. *
  47. * @param string $table
  48. * @param string $idField
  49. * @param string|integer $rowId
  50. * @param string|array $field
  51. * @param mixed|null $value
  52. * @param string $parentField
  53. * @param string|integer $parentId
  54. * @return $this
  55. */
  56. public function updateTableRow($table, $idField, $rowId, $field, $value = null, $parentField = null, $parentId = 0);
  57. /**
  58. * Gets event manager
  59. *
  60. * @return \Magento\Framework\Event\ManagerInterface
  61. */
  62. public function getEventManager();
  63. /**
  64. * Gets filesystem
  65. *
  66. * @return \Magento\Framework\Filesystem
  67. */
  68. public function getFilesystem();
  69. /**
  70. * Create migration setup
  71. *
  72. * @param array $data
  73. * @return \Magento\Framework\Module\Setup\Migration
  74. */
  75. public function createMigrationSetup(array $data = []);
  76. /**
  77. * Gets setup cache
  78. *
  79. * @return DataCacheInterface
  80. */
  81. public function getSetupCache();
  82. }