Created
September 13, 2017 09:20
-
-
Save dnahrebecki/99a6ccd730eae8d5d402c5e90cb226f9 to your computer and use it in GitHub Desktop.
Message Processor which listen to Contact's email changes and call API
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 ClientCustomBundle\Async; | |
use Oro\Component\MessageQueue\Client\TopicSubscriberInterface; | |
use Oro\Component\MessageQueue\Consumption\MessageProcessorInterface; | |
use Oro\Component\MessageQueue\Transport\MessageInterface; | |
use Oro\Component\MessageQueue\Transport\SessionInterface; | |
use Oro\Bundle\DataAuditBundle\Async\Topics; | |
class ContactEmailChangeProcessor implements MessageProcessorInterface, TopicSubscriberInterface | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function process(MessageInterface $message, SessionInterface $session) | |
{ | |
// check if entity == Contact and field == email | |
// if yes -> call frontend's API with that data | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public static function getSubscribedTopics() | |
{ | |
return [Topics::ENTITIES_CHANGED]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment