Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

GlobalParam.php 634B

1234567891011121314151617181920212223242526272829
  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. }