Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\EventDispatcher; Chris@0: Chris@0: /** Chris@0: * Event is the base class for classes containing event data. Chris@0: * Chris@0: * This class contains no event data. It is used by events that do not pass Chris@0: * state information to an event handler when an event is raised. Chris@0: * Chris@0: * You can call the method stopPropagation() to abort the execution of Chris@0: * further listeners in your event listener. Chris@0: * Chris@0: * @author Guilherme Blanco Chris@0: * @author Jonathan Wage Chris@0: * @author Roman Borschel Chris@0: * @author Bernhard Schussek Chris@0: */ Chris@0: class Event Chris@0: { Chris@0: /** Chris@0: * @var bool Whether no further event listeners should be triggered Chris@0: */ Chris@0: private $propagationStopped = false; Chris@0: Chris@0: /** Chris@0: * Returns whether further event listeners should be triggered. Chris@0: * Chris@0: * @see Event::stopPropagation() Chris@0: * Chris@0: * @return bool Whether propagation was already stopped for this event Chris@0: */ Chris@0: public function isPropagationStopped() Chris@0: { Chris@0: return $this->propagationStopped; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Stops the propagation of the event to further event listeners. Chris@0: * Chris@0: * If multiple event listeners are connected to the same event, no Chris@0: * further event listener will be triggered once any trigger calls Chris@0: * stopPropagation(). Chris@0: */ Chris@0: public function stopPropagation() Chris@0: { Chris@0: $this->propagationStopped = true; Chris@0: } Chris@0: }