StoreManagerInterface.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Store\Model;
  7. use Magento\Framework\Exception\NoSuchEntityException;
  8. /**
  9. * Store manager interface
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface StoreManagerInterface
  15. {
  16. /**
  17. * Store cache context
  18. */
  19. const CONTEXT_STORE = 'store';
  20. /**
  21. * The store GET Param name
  22. */
  23. const PARAM_NAME = '___store';
  24. /**
  25. * Allow or disallow single store mode
  26. *
  27. * @param bool $value
  28. * @return void
  29. */
  30. public function setIsSingleStoreModeAllowed($value);
  31. /**
  32. * Check if store has only one store view
  33. *
  34. * @return bool
  35. */
  36. public function hasSingleStore();
  37. /**
  38. * Check if system is run in the single store mode
  39. *
  40. * @return bool
  41. */
  42. public function isSingleStoreMode();
  43. /**
  44. * Retrieve application store object
  45. *
  46. * @param null|string|bool|int|\Magento\Store\Api\Data\StoreInterface $storeId
  47. * @return \Magento\Store\Api\Data\StoreInterface
  48. * @throws NoSuchEntityException If given store doesn't exist.
  49. */
  50. public function getStore($storeId = null);
  51. /**
  52. * Retrieve stores array
  53. *
  54. * @param bool $withDefault
  55. * @param bool $codeKey
  56. * @return \Magento\Store\Api\Data\StoreInterface[]
  57. */
  58. public function getStores($withDefault = false, $codeKey = false);
  59. /**
  60. * Retrieve application website object
  61. *
  62. * @param null|bool|int|string|\Magento\Store\Api\Data\WebsiteInterface $websiteId
  63. * @return \Magento\Store\Api\Data\WebsiteInterface
  64. * @throws \Magento\Framework\Exception\LocalizedException
  65. */
  66. public function getWebsite($websiteId = null);
  67. /**
  68. * Get loaded websites
  69. *
  70. * @param bool $withDefault
  71. * @param bool $codeKey
  72. * @return \Magento\Store\Api\Data\WebsiteInterface[]
  73. */
  74. public function getWebsites($withDefault = false, $codeKey = false);
  75. /**
  76. * Reinitialize store list
  77. *
  78. * @return void
  79. */
  80. public function reinitStores();
  81. /**
  82. * Retrieve default store for default group and website
  83. *
  84. * @return \Magento\Store\Api\Data\StoreInterface|null
  85. */
  86. public function getDefaultStoreView();
  87. /**
  88. * Retrieve application store group object
  89. *
  90. * @param null|\Magento\Store\Api\Data\GroupInterface|string $groupId
  91. * @return \Magento\Store\Api\Data\GroupInterface
  92. */
  93. public function getGroup($groupId = null);
  94. /**
  95. * Prepare array of store groups
  96. *
  97. * @param bool $withDefault
  98. * @return \Magento\Store\Api\Data\GroupInterface[]
  99. */
  100. public function getGroups($withDefault = false);
  101. /**
  102. * Set current default store
  103. *
  104. * @param string $store
  105. * @return void
  106. */
  107. public function setCurrentStore($store);
  108. }