vendor/launchpad/backend/src/Base/EventSubscriber/User/UserEventSubscriber.php line 43

Open in your IDE?
  1. <?php
  2. namespace LaunchPad\Bundle\LaunchPadBundle\Base\EventSubscriber\User;
  3. use LaunchPad\Bundle\LaunchPadBundle\Admin\Service\UserAdminService;
  4. use LaunchPad\Bundle\LaunchPadBundle\Base\Entity\KYC\KycProcess;
  5. use LaunchPad\Bundle\LaunchPadBundle\Base\Service\UserService;
  6. use LaunchPad\Bundle\LaunchPadBundle\Base\Service\Processor\GPS\GpsImportHandler;
  7. use LaunchPad\Bundle\LaunchPadBundle\Base\Service\Notifications\NotificationTypes\KYC\KycSuccessfulNotification;
  8. use Psr\Container\ContainerInterface;
  9. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  10. use Symfony\Component\EventDispatcher\GenericEvent;
  11. use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
  12. class UserEventSubscriber implements EventSubscriberInterface
  13. {
  14.     private $container;
  15.     public function __construct(ContainerInterface $container)
  16.     {
  17.         $this->container $container;
  18.     }
  19.     /**
  20.      * Get subscribed events
  21.      * 
  22.      * @return array
  23.      */
  24.     public static function getSubscribedEvents()
  25.     {
  26.         return array(
  27.             UserService::EVENT_ACCOUNT_UPDATED    => 'accountUpdate',
  28.             UserAdminService::EVENT_USER_CREATED => 'userCreated',
  29.         );
  30.     }
  31.     /**
  32.      * Document requested
  33.      *
  34.      * @param GenericEvent $event
  35.      */
  36.     public function accountUpdate(GenericEvent $event)
  37.     {
  38.         $user $event->getSubject();
  39.         $this->container->get('lp.payment_device')->updateCardholderDataForUser($user);
  40.     }
  41.     /**
  42.      * Called on user create
  43.      * 
  44.      * @param GenericEvent $event
  45.      * @throws \Exception
  46.      */
  47.     public function userCreated(GenericEvent $event)
  48.     {
  49.         $this->container->get('lp.account')->userCreated($event->getSubject());
  50.     }
  51. }