Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • ContainerAwareEventDispatcher
  • Event
  • EventDispatcher
  • GenericEvent
  • ImmutableEventDispatcher

Interfaces

  • EventDispatcherInterface
  • EventSubscriberInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
  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: namespace Symfony\Component\EventDispatcher;
 13: 
 14: /**
 15:  * Event is the base class for classes containing event data.
 16:  *
 17:  * This class contains no event data. It is used by events that do not pass
 18:  * state information to an event handler when an event is raised.
 19:  *
 20:  * You can call the method stopPropagation() to abort the execution of
 21:  * further listeners in your event listener.
 22:  *
 23:  * @author  Guilherme Blanco <guilhermeblanco@hotmail.com>
 24:  * @author  Jonathan Wage <jonwage@gmail.com>
 25:  * @author  Roman Borschel <roman@code-factory.org>
 26:  * @author  Bernhard Schussek <bschussek@gmail.com>
 27:  *
 28:  * @api
 29:  */
 30: class Event
 31: {
 32:     /**
 33:      * @var Boolean Whether no further event listeners should be triggered
 34:      */
 35:     private $propagationStopped = false;
 36: 
 37:     /**
 38:      * @var EventDispatcher Dispatcher that dispatched this event
 39:      */
 40:     private $dispatcher;
 41: 
 42:     /**
 43:      * @var string This event's name
 44:      */
 45:     private $name;
 46: 
 47:     /**
 48:      * Returns whether further event listeners should be triggered.
 49:      *
 50:      * @see Event::stopPropagation
 51:      * @return Boolean Whether propagation was already stopped for this event.
 52:      *
 53:      * @api
 54:      */
 55:     public function isPropagationStopped()
 56:     {
 57:         return $this->propagationStopped;
 58:     }
 59: 
 60:     /**
 61:      * Stops the propagation of the event to further event listeners.
 62:      *
 63:      * If multiple event listeners are connected to the same event, no
 64:      * further event listener will be triggered once any trigger calls
 65:      * stopPropagation().
 66:      *
 67:      * @api
 68:      */
 69:     public function stopPropagation()
 70:     {
 71:         $this->propagationStopped = true;
 72:     }
 73: 
 74:     /**
 75:      * Stores the EventDispatcher that dispatches this Event
 76:      *
 77:      * @param EventDispatcherInterface $dispatcher
 78:      *
 79:      * @api
 80:      */
 81:     public function setDispatcher(EventDispatcherInterface $dispatcher)
 82:     {
 83:         $this->dispatcher = $dispatcher;
 84:     }
 85: 
 86:     /**
 87:      * Returns the EventDispatcher that dispatches this Event
 88:      *
 89:      * @return EventDispatcherInterface
 90:      *
 91:      * @api
 92:      */
 93:     public function getDispatcher()
 94:     {
 95:         return $this->dispatcher;
 96:     }
 97: 
 98:     /**
 99:      * Gets the event's name.
100:      *
101:      * @return string
102:      *
103:      * @api
104:      */
105:     public function getName()
106:     {
107:         return $this->name;
108:     }
109: 
110:     /**
111:      * Sets the event's name property.
112:      *
113:      * @param string $name The event name.
114:      *
115:      * @api
116:      */
117:     public function setName($name)
118:     {
119:         $this->name = $name;
120:     }
121: }
122: 
php-coveralls API documentation generated by ApiGen 2.8.0