You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
634B

  1. <?php
  2. namespace Lc\ShopBundle\Services;
  3. use Lc\ShopBundle\Context\GlobalParamInterface;
  4. use Symfony\Component\Security\Core\Security;
  5. class GlobalParam
  6. {
  7. private $security;
  8. public function __construct(Security $security)
  9. {
  10. $this->security = $security ;
  11. }
  12. public function getCurrentMerchant()
  13. {
  14. $user = $this->security->getUser() ;
  15. if($user && $user->getMerchant()) {
  16. return $user->getMerchant() ;
  17. }
  18. else {
  19. return false ;
  20. }
  21. }
  22. }