DefaultStoreScopeProvider.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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\Model\Entity\ScopeProviderInterface;
  8. use Magento\Store\Model\Store;
  9. use Magento\Framework\Model\Entity\ScopeFactory;
  10. /**
  11. * Class StoreScope
  12. */
  13. class DefaultStoreScopeProvider implements ScopeProviderInterface
  14. {
  15. /**
  16. * @var ScopeFactory
  17. */
  18. private $scopeFactory;
  19. /**
  20. * StoreScopeProvider constructor.
  21. *
  22. * @param ScopeFactory $scopeFactory
  23. */
  24. public function __construct(
  25. ScopeFactory $scopeFactory
  26. ) {
  27. $this->scopeFactory = $scopeFactory;
  28. }
  29. /**
  30. * @param string $entityType
  31. * @param array $entityData
  32. * @return \Magento\Framework\Model\Entity\ScopeInterface
  33. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  34. */
  35. public function getContext($entityType, $entityData = [])
  36. {
  37. return $this->scopeFactory->create(Store::STORE_ID, Store::DEFAULT_STORE_ID, null);
  38. }
  39. }