No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

InitializeEventSubscriber.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace Lc\ShopBundle\EventSubscriber;
  3. use Lc\ShopBundle\Context\FilterMerchantInterface;
  4. use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface;
  5. use Lc\ShopBundle\Context\MerchantUtilsInterface;
  6. use Lc\ShopBundle\Context\SortableInterface;
  7. use Lc\ShopBundle\Context\StatusInterface;
  8. use Lc\ShopBundle\Context\TreeInterface;
  9. use Lc\ShopBundle\Services\Utils;
  10. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  11. use Symfony\Component\EventDispatcher\GenericEvent;
  12. class InitializeEventSubscriber implements EventSubscriberInterface
  13. {
  14. public $merchantUtils;
  15. public $utils;
  16. public function __construct(MerchantUtilsInterface $merchantUtils, Utils $utils)
  17. {
  18. $this->merchantUtils = $merchantUtils;
  19. $this->utils = $utils;
  20. }
  21. public static function getSubscribedEvents()
  22. {
  23. return array(
  24. 'easy_admin.post_initialize' => array('postInitialize'),
  25. );
  26. }
  27. public function postInitialize(GenericEvent $event)
  28. {
  29. $request = $event->getArgument('request');
  30. die('ncici');
  31. if($request->query->get('hubredirection')){
  32. $this->utils->addFlash('alert', "Vous êtes maintenant sur le hub de ".$this->merchantUtils->getMerchantCurrent()->getTitle());
  33. }
  34. }
  35. }