plugins/RewardPointPlugin/Handler/LoginWaveRewardPointAccountHandler.php line 33

Open in your IDE?
  1. <?php
  2. namespace RewardPointPlugin\Handler;
  3. use Biz\System\Service\SettingService;
  4. use Codeages\Biz\Framework\Event\Event;
  5. use Symfony\Component\DependencyInjection\ContainerInterface;
  6. use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
  7. class LoginWaveRewardPointAccountHandler
  8. {
  9.     /**
  10.      * @var ContainerInterface
  11.      */
  12.     private $container;
  13.     /**
  14.      * @var Biz
  15.      */
  16.     private $biz;
  17.     public function __construct(ContainerInterface $container)
  18.     {
  19.         $this->container $container;
  20.         $this->biz $this->container->get('biz');
  21.     }
  22.     /**
  23.      * Do the magic.
  24.      *
  25.      * @param InteractiveLoginEvent $event
  26.      */
  27.     public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
  28.     {
  29.         $user $this->biz['user'];
  30.         if ($user['type'] == 'system') {
  31.             return;
  32.         }
  33.         $this->biz['dispatcher']->dispatch(new Event($user), 'user.login');
  34.     }
  35.     /**
  36.      * @return SettingService
  37.      */
  38.     protected function getSettingService()
  39.     {
  40.         return $this->biz->service('System:SettingService');
  41.     }
  42. }