<?php
namespace LaunchPad\Bundle\LaunchPadBundle\Base\EventSubscriber\User;
use LaunchPad\Bundle\LaunchPadBundle\Admin\Service\UserAdminService;
use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\KYC\KycProcess;
use LaunchPad\Bundle\LaunchPadBundle\Base\Service\UserService;
use LaunchPad\Bundle\LaunchPadBundle\Base\Service\Processor\GPS\GpsImportHandler;
use LaunchPad\Bundle\LaunchPadBundle\Base\Service\Notifications\NotificationTypes\KYC\KycSuccessfulNotification;
use Psr\Container\ContainerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
class UserEventSubscriber implements EventSubscriberInterface
{
private $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
/**
* Get subscribed events
*
* @return array
*/
public static function getSubscribedEvents()
{
return array(
UserService::EVENT_ACCOUNT_UPDATED => 'accountUpdate',
UserAdminService::EVENT_USER_CREATED => 'userCreated',
);
}
/**
* Document requested
*
* @param GenericEvent $event
*/
public function accountUpdate(GenericEvent $event)
{
$user = $event->getSubject();
$this->container->get('lp.payment_device')->updateCardholderDataForUser($user);
}
/**
* Called on user create
*
* @param GenericEvent $event
* @throws \Exception
*/
public function userCreated(GenericEvent $event)
{
$this->container->get('lp.account')->userCreated($event->getSubject());
}
}