<?php
namespace LaunchPad\Bundle\LaunchPadBundle\Base\EventSubscriber\Account;
use LaunchPad\Bundle\LaunchPadBundle\Base\Service\Processor\GPS\GpsImportHandler;
use Psr\Container\ContainerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
class AccountEventSubscriber implements EventSubscriberInterface
{
private $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public static function getSubscribedEvents()
{
return array(
GpsImportHandler::GPS_ACCOUNT_UPDATE => 'accountUpdate',
);
}
/**
* Document requested
*
* @param GenericEvent $event
*/
public function accountUpdate(GenericEvent $event)
{
$data = $event->getSubject();
$this->container->get('lp.card')->updateCardFromImport($data['token'], $data['data']);
}
}