Retriever.php 701 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Model\Group;
  7. use Magento\Customer\Model\Session;
  8. /**
  9. * Class for getting current customer group from customer session.
  10. */
  11. class Retriever implements RetrieverInterface
  12. {
  13. /**
  14. * @var Session
  15. */
  16. private $customerSession;
  17. /**
  18. * @param Session $customerSession
  19. */
  20. public function __construct(Session $customerSession)
  21. {
  22. $this->customerSession = $customerSession;
  23. }
  24. /**
  25. * @inheritdoc
  26. */
  27. public function getCustomerGroupId()
  28. {
  29. return $this->customerSession->getCustomerGroupId();
  30. }
  31. }