From f6fb778c3e20781530434bdec81daca0af837a54 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 22 Oct 2013 09:48:24 +0200 Subject: [PATCH] create newsletter listener --- core/lib/Thelia/Action/Newsletter.php | 70 +++++++++++++++++++++ core/lib/Thelia/Config/Resources/action.xml | 4 ++ 2 files changed, 74 insertions(+) create mode 100644 core/lib/Thelia/Action/Newsletter.php diff --git a/core/lib/Thelia/Action/Newsletter.php b/core/lib/Thelia/Action/Newsletter.php new file mode 100644 index 000000000..fd5aeeb6c --- /dev/null +++ b/core/lib/Thelia/Action/Newsletter.php @@ -0,0 +1,70 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Action; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Thelia\Core\Event\Newsletter\NewsletterEvent; +use Thelia\Core\Event\TheliaEvents; +use Thelia\Tests\Action\BaseAction; + + +/** + * Class Newsletter + * @package Thelia\Action + * @author Manuel Raynaud + */ +class Newsletter extends BaseAction implements EventSubscriberInterface +{ + + public function subscribe(NewsletterEvent $event) + { + + } + + /** + * Returns an array of event names this subscriber wants to listen to. + * + * The array keys are event names and the value can be: + * + * * The method name to call (priority defaults to 0) + * * An array composed of the method name to call and the priority + * * An array of arrays composed of the method names to call and respective + * priorities, or 0 if unset + * + * For instance: + * + * * array('eventName' => 'methodName') + * * array('eventName' => array('methodName', $priority)) + * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) + * + * @return array The event names to listen to + * + * @api + */ + public static function getSubscribedEvents() + { + return array( + TheliaEvents::NEWSLETTER_SUBSCRIBE => array('subscribe', 128) + ); + } +} \ No newline at end of file diff --git a/core/lib/Thelia/Config/Resources/action.xml b/core/lib/Thelia/Config/Resources/action.xml index 4bc25b65d..e5d6c9492 100755 --- a/core/lib/Thelia/Config/Resources/action.xml +++ b/core/lib/Thelia/Config/Resources/action.xml @@ -156,6 +156,10 @@ + + + +