ViewInterface.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Mview;
  7. /**
  8. * Interface \Magento\Framework\Mview\ViewInterface
  9. *
  10. */
  11. interface ViewInterface
  12. {
  13. /**
  14. * Return view ID
  15. *
  16. * @return string
  17. */
  18. public function getId();
  19. /**
  20. * Return view action class
  21. *
  22. * @return string
  23. */
  24. public function getActionClass();
  25. /**
  26. * Return view group
  27. *
  28. * @return string
  29. */
  30. public function getGroup();
  31. /**
  32. * Return view subscriptions
  33. *
  34. * @return array
  35. */
  36. public function getSubscriptions();
  37. /**
  38. * Fill view data from config
  39. *
  40. * @param string $viewId
  41. * @return ViewInterface
  42. * @throws \InvalidArgumentException
  43. */
  44. public function load($viewId);
  45. /**
  46. * Create subscriptions
  47. *
  48. * @throws \Exception
  49. * @return ViewInterface
  50. */
  51. public function subscribe();
  52. /**
  53. * Remove subscriptions
  54. *
  55. * @throws \Exception
  56. * @return ViewInterface
  57. */
  58. public function unsubscribe();
  59. /**
  60. * Materialize view by IDs in changelog
  61. *
  62. * @return void
  63. * @throws \Exception
  64. */
  65. public function update();
  66. /**
  67. * Pause view updates and set version ID to changelog's end
  68. *
  69. * @return void
  70. */
  71. public function suspend();
  72. /**
  73. * Resume view updates
  74. *
  75. * @return void
  76. */
  77. public function resume();
  78. /**
  79. * Clear precessed changelog entries
  80. *
  81. * @return void
  82. */
  83. public function clearChangelog();
  84. /**
  85. * Return related state object
  86. *
  87. * @return View\StateInterface
  88. */
  89. public function getState();
  90. /**
  91. * Set view state object
  92. *
  93. * @param View\StateInterface $state
  94. * @return ViewInterface
  95. */
  96. public function setState(View\StateInterface $state);
  97. /**
  98. * Check whether view is enabled
  99. *
  100. * @return bool
  101. */
  102. public function isEnabled();
  103. /**
  104. * Check whether view is idle
  105. *
  106. * @return bool
  107. */
  108. public function isIdle();
  109. /**
  110. * Check whether view is working
  111. *
  112. * @return bool
  113. */
  114. public function isWorking();
  115. /**
  116. * Check whether view is paused
  117. *
  118. * @return bool
  119. */
  120. public function isSuspended();
  121. /**
  122. * Return view updated datetime
  123. *
  124. * @return string
  125. */
  126. public function getUpdated();
  127. /**
  128. * Retrieve linked changelog
  129. *
  130. * @return View\ChangelogInterface
  131. */
  132. public function getChangelog();
  133. }