- <?php
-
- namespace Lc\ShopBundle\Services;
-
- use App\Repository\HubRepository;
- use Lc\ShopBundle\Context\GlobalParamInterface;
- use Lc\ShopBundle\Repository\MerchantRepository;
- use Symfony\Component\Security\Core\Security;
-
- class GlobalParam
- {
- protected $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 ;
- }
- }
- }
|