This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/EventDispatcher/Event.php

59 lines
1.6 KiB
PHP
Raw Normal View History

2010-01-04 14:26:20 +00:00
<?php
/*
* This file is part of the Symfony package.
2010-04-07 02:07:59 +01:00
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2010-01-04 14:26:20 +00:00
*/
namespace Symfony\Component\EventDispatcher;
2010-01-04 14:26:20 +00:00
/**
* Event is the base class for classes containing event data.
2010-01-04 14:26:20 +00:00
*
* This class contains no event data. It is used by events that do not pass
* state information to an event handler when an event is raised.
*
* You can call the method stopPropagation() to abort the execution of
* further listeners in your event listener.
*
2014-12-07 17:02:39 +00:00
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @author Bernhard Schussek <bschussek@gmail.com>
2010-01-04 14:26:20 +00:00
*/
class Event
2010-01-04 14:26:20 +00:00
{
/**
2014-12-20 17:15:52 +00:00
* @var bool Whether no further event listeners should be triggered
*/
private $propagationStopped = false;
/**
* Returns whether further event listeners should be triggered.
*
* @see Event::stopPropagation()
2014-12-21 17:00:50 +00:00
*
* @return bool Whether propagation was already stopped for this event
*/
public function isPropagationStopped()
{
return $this->propagationStopped;
}
/**
* Stops the propagation of the event to further event listeners.
*
* If multiple event listeners are connected to the same event, no
* further event listener will be triggered once any trigger calls
* stopPropagation().
*/
public function stopPropagation()
{
$this->propagationStopped = true;
}
2010-01-04 14:26:20 +00:00
}