Home » Php » How can an arbitrary subscriber be stopped without stopping others?

How can an arbitrary subscriber be stopped without stopping others?

Posted by: admin June 30, 2018 Leave a comment

Questions:

Assume I have an event called XXX and two different complex subscribers, that can look like this:

class SubscriberOneXXX extends EventSubscriber {
    function actionWithPriority1() { ... }
    function actionWithPriority2() { ... }
    function actionWithPriority3() { ... }
}

And the second one:

class SubscriberTwoXXX extends EventSubscriber {
    function actionWithPriority1() { ... }
    function actionWithPriority2() { ... }
    function actionWithPriority3() { ... }
}

We may assume that these two subscribers represent different workflows of parallel processes and are independent.

How can I stop event propagation in SubscriberOneXXX and skip remained actions, but allow other subscribers to process the event?

Answers: