|
1234567891011121314151617181920212223242526272829 |
- <?php
-
- namespace Lc\ShopBundle\Services;
-
- use Lc\ShopBundle\Context\GlobalParamInterface;
- use Symfony\Component\Security\Core\Security;
-
- class GlobalParam
- {
- private $security;
-
- public function __construct(Security $security)
- {
- $this->security = $security ;
- }
-
- public function getCurrentMerchant()
- {
- $user = $this->security->getUser() ;
-
- if($user && $user->getMerchant()) {
- return $user->getMerchant() ;
- }
- else {
- return false ;
- }
- }
-
- }
|