<?php
namespace RewardPointPlugin\Handler;
use Biz\System\Service\SettingService;
use Codeages\Biz\Framework\Event\Event;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
class LoginWaveRewardPointAccountHandler
{
/**
* @var ContainerInterface
*/
private $container;
/**
* @var Biz
*/
private $biz;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
$this->biz = $this->container->get('biz');
}
/**
* Do the magic.
*
* @param InteractiveLoginEvent $event
*/
public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
{
$user = $this->biz['user'];
if ($user['type'] == 'system') {
return;
}
$this->biz['dispatcher']->dispatch(new Event($user), 'user.login');
}
/**
* @return SettingService
*/
protected function getSettingService()
{
return $this->biz->service('System:SettingService');
}
}