Created
May 29, 2015 11:22
-
-
Save ScullWM/8acea9c0e229ed76717f to your computer and use it in GitHub Desktop.
Easy Exemple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Swm\Bundle\ForumBundle\Listener; | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Swm\Bundle\MailHookBundle\Event\HookEventInterface; | |
/** | |
* @DI\Service() | |
*/ | |
class BounceListener | |
{ | |
private $userManager; | |
/** | |
* @DI\InjectParams({ | |
* "userManager" = @DI\Inject("fos_user.user_manager") | |
* }) | |
*/ | |
public function __construct($userManager) | |
{ | |
$this->userManager = $userManager; | |
} | |
/** | |
* @DI\Observe(Swm\Bundle\MailHookBundle\SwmMailHookEvent::MAILHOOK_HARDBOUNCE) | |
*/ | |
public function hardBounce(HookEventInterface $hookEvent) | |
{ | |
$user = $hookEvent->getUser(); | |
$this->userManager->doThings($user); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment