| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the Symfony package. |
| 5 |
* |
| 6 |
* (c) Fabien Potencier <fabien@symfony.com> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
/** |
| 13 |
* Event is the base class for classes containing event data. |
| 14 |
* |
| 15 |
* This class contains no event data. It is used by events that do not pass |
| 16 |
* state information to an event handler when an event is raised. |
| 17 |
* |
| 18 |
* You can call the method stopPropagation() to abort the execution of |
| 19 |
* further listeners in your event listener. |
| 20 |
* |
| 21 |
* @author Guilherme Blanco <guilhermeblanco@hotmail.com> |
| 22 |
* @author Jonathan Wage <jonwage@gmail.com> |
| 23 |
* @author Roman Borschel <roman@code-factory.org> |
| 24 |
* @author Bernhard Schussek <bschussek@gmail.com> |
| 25 |
* |
| 26 |
* @api |
| 27 |
*/ |
| 28 |
class Symfony_EventDispatcher_Event |
| 29 |
{ |
| 30 |
|
| 31 |
/** |
| 32 |
* @var bool Whether no further event listeners should be triggered |
| 33 |
*/ |
| 34 |
private $propagationStopped = false; |
| 35 |
|
| 36 |
/** |
| 37 |
* Returns whether further event listeners should be triggered. |
| 38 |
* |
| 39 |
* @see Symfony_EventDispatcher_Event::stopPropagation |
| 40 |
* @return bool Whether propagation was already stopped for this event. |
| 41 |
* |
| 42 |
* @api |
| 43 |
*/ |
| 44 |
public function isPropagationStopped() |
| 45 |
{ |
| 46 |
return $this->propagationStopped; |
| 47 |
} |
| 48 |
|
| 49 |
/** |
| 50 |
* Stops the propagation of the event to further event listeners. |
| 51 |
* |
| 52 |
* If multiple event listeners are connected to the same event, no |
| 53 |
* further event listener will be triggered once any trigger calls |
| 54 |
* stopPropagation(). |
| 55 |
* |
| 56 |
* @api |
| 57 |
*/ |
| 58 |
public function stopPropagation() |
| 59 |
{ |
| 60 |
$this->propagationStopped = true; |
| 61 |
} |
| 62 |
} |
| 63 |
|