DataCacheInterface.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. * Data setup cache
  9. */
  10. interface DataCacheInterface
  11. {
  12. /**
  13. * Set data of a row
  14. *
  15. * @param string $table
  16. * @param string $parentId
  17. * @param string $rowId
  18. * @param mixed $value
  19. * @return void
  20. */
  21. public function setRow($table, $parentId, $rowId, $value);
  22. /**
  23. * Set data of a field
  24. *
  25. * @param string $table
  26. * @param string $parentId
  27. * @param string $rowId
  28. * @param string $field
  29. * @param mixed $value
  30. * @return void
  31. */
  32. public function setField($table, $parentId, $rowId, $field, $value);
  33. /**
  34. * Gets requested row/field
  35. *
  36. * @param string $table
  37. * @param string $parentId
  38. * @param string $rowId
  39. * @param string|null $field
  40. * @return mixed Returns false if there is no such record
  41. */
  42. public function get($table, $parentId, $rowId, $field = null);
  43. /**
  44. * Removed requested row
  45. *
  46. * @param string $table
  47. * @param string $parentId
  48. * @param string $rowId
  49. * @return void
  50. */
  51. public function remove($table, $parentId, $rowId);
  52. /**
  53. * Checks if requested data exists
  54. *
  55. * @param string $table
  56. * @param string $parentId
  57. * @param string $rowId
  58. * @param string|null $field
  59. * @return bool
  60. */
  61. public function has($table, $parentId, $rowId, $field = null);
  62. }