StateInterface.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Mview\View;
  7. /**
  8. * Interface \Magento\Framework\Mview\View\StateInterface
  9. *
  10. */
  11. interface StateInterface
  12. {
  13. /**#@+
  14. * View modes
  15. */
  16. const MODE_ENABLED = 'enabled';
  17. const MODE_DISABLED = 'disabled';
  18. /**#@-*/
  19. /**#@+
  20. * View statuses
  21. */
  22. const STATUS_IDLE = 'idle';
  23. const STATUS_WORKING = 'working';
  24. const STATUS_SUSPENDED = 'suspended';
  25. /**#@-*/
  26. /**
  27. * Fill object with state data by view ID
  28. *
  29. * @param string $viewId
  30. * @return $this
  31. */
  32. public function loadByView($viewId);
  33. /**
  34. * Save state object
  35. *
  36. * @return \Magento\Framework\Mview\View\StateInterface
  37. * @throws \Exception
  38. */
  39. public function save();
  40. /**
  41. * Delete state object
  42. *
  43. * @return \Magento\Framework\Mview\View\StateInterface
  44. * @throws \Exception
  45. */
  46. public function delete();
  47. /**
  48. * Get state view ID
  49. *
  50. * @return string
  51. */
  52. public function getViewId();
  53. /**
  54. * Get state mode
  55. *
  56. * @return string
  57. */
  58. public function getMode();
  59. /**
  60. * Set state mode
  61. *
  62. * @param string $mode
  63. * @return \Magento\Framework\Mview\View\StateInterface
  64. */
  65. public function setMode($mode);
  66. /**
  67. * Get state status
  68. *
  69. * @return string
  70. */
  71. public function getStatus();
  72. /**
  73. * Set state status
  74. *
  75. * @param string $status
  76. * @return \Magento\Framework\Mview\View\StateInterface
  77. */
  78. public function setStatus($status);
  79. /**
  80. * Get state version ID
  81. *
  82. * @return string
  83. */
  84. public function getVersionId();
  85. /**
  86. * Set state version ID
  87. *
  88. * @param int $versionId
  89. * @return \Magento\Framework\Mview\View\StateInterface
  90. */
  91. public function setVersionId($versionId);
  92. /**
  93. * Get state updated time
  94. *
  95. * @return string
  96. */
  97. public function getUpdated();
  98. /**
  99. * Set state updated time
  100. *
  101. * @param string|int|\DateTimeInterface $updated
  102. * @return \Magento\Framework\Mview\View\StateInterface
  103. */
  104. public function setUpdated($updated);
  105. }