PHP 클래스 Symfony\Component\EventDispatcher\EventDispatcher

Listeners are registered on the manager and events are dispatched through the manager.
저자: Guilherme Blanco ([email protected])
저자: Jonathan Wage ([email protected])
저자: Roman Borschel ([email protected])
저자: Bernhard Schussek ([email protected])
저자: Fabien Potencier ([email protected])
저자: Jordi Boggiano ([email protected])
저자: Jordan Alliot ([email protected])
상속: implements Symfony\Component\EventDispatcher\EventDispatcherInterface
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

공개 메소드들

메소드 설명
addListener ( $eventName, $listener, $priority )
addSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
connect ( string $name, mixed $listener, integer $priority ) Connects a listener to a given event name.
disconnect ( string $name ) Disconnects all listeners for the given event name.
dispatch ( $eventName, Symfony\Component\EventDispatcher\Event $event = null )
filter ( Symfony\Component\EventDispatcher\Event $event, mixed $value ) : Symfony\Component\EventDispatcher\Event Filters a value by calling all listeners of a given event.
getListeners ( $eventName = null )
getListeners ( string $name ) : array Returns all listeners associated with a given event name.
hasListeners ( $eventName = null )
hasListeners ( string $name ) : boolean Returns true if the given event name has some listeners.
notify ( Symfony\Component\EventDispatcher\Event $event ) : Symfony\Component\EventDispatcher\Event Notifies all listeners of a given event.
notifyUntil ( Symfony\Component\EventDispatcher\Event $event ) : Symfony\Component\EventDispatcher\Event Notifies all listeners of a given event until one returns a non null value.
removeListener ( $eventName, $listener )
removeSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )

보호된 메소드들

메소드 설명
doDispatch ( array[callback] $listeners, string $eventName, Symfony\Component\EventDispatcher\Event $event ) Triggers the listeners of an event.

비공개 메소드들

메소드 설명
sortListeners ( string $eventName ) Sorts the internal list of listeners for the given event by priority.

메소드 상세

addListener() 공개 메소드

또한 보기: EventDispatcherInterface::addListener
public addListener ( $eventName, $listener, $priority )

addSubscriber() 공개 메소드

또한 보기: EventDispatcherInterface::addSubscriber
public addSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
$subscriber Symfony\Component\EventDispatcher\EventSubscriberInterface

connect() 공개 메소드

Connects a listener to a given event name.
public connect ( string $name, mixed $listener, integer $priority )
$name string An event name
$listener mixed A PHP callable
$priority integer The priority (between -10 and 10 -- defaults to 0)

disconnect() 공개 메소드

Disconnects all listeners for the given event name.
public disconnect ( string $name )
$name string An event name

dispatch() 공개 메소드

또한 보기: EventDispatcherInterface::dispatch
public dispatch ( $eventName, Symfony\Component\EventDispatcher\Event $event = null )
$event Symfony\Component\EventDispatcher\Event

doDispatch() 보호된 메소드

This method can be overridden to add functionality that is executed for each listener.
protected doDispatch ( array[callback] $listeners, string $eventName, Symfony\Component\EventDispatcher\Event $event )
$listeners array[callback]
$eventName string The name of the event to dispatch.
$event Symfony\Component\EventDispatcher\Event The event object to pass to the event handlers/listeners.

filter() 공개 메소드

Filters a value by calling all listeners of a given event.
public filter ( Symfony\Component\EventDispatcher\Event $event, mixed $value ) : Symfony\Component\EventDispatcher\Event
$event Symfony\Component\EventDispatcher\Event An Event instance
$value mixed The value to be filtered
리턴 Symfony\Component\EventDispatcher\Event The Event instance

getListeners() 공개 메소드

또한 보기: EventDispatcherInterface::getListeners
public getListeners ( $eventName = null )

getListeners() 공개 메소드

Returns all listeners associated with a given event name.
public getListeners ( string $name ) : array
$name string The event name
리턴 array An array of listeners

hasListeners() 공개 메소드

또한 보기: EventDispatcherInterface::hasListeners
public hasListeners ( $eventName = null )

hasListeners() 공개 메소드

Returns true if the given event name has some listeners.
public hasListeners ( string $name ) : boolean
$name string The event name
리턴 boolean true if some listeners are connected, false otherwise

notify() 공개 메소드

Notifies all listeners of a given event.
public notify ( Symfony\Component\EventDispatcher\Event $event ) : Symfony\Component\EventDispatcher\Event
$event Symfony\Component\EventDispatcher\Event An Event instance
리턴 Symfony\Component\EventDispatcher\Event The Event instance

notifyUntil() 공개 메소드

Notifies all listeners of a given event until one returns a non null value.
public notifyUntil ( Symfony\Component\EventDispatcher\Event $event ) : Symfony\Component\EventDispatcher\Event
$event Symfony\Component\EventDispatcher\Event An Event instance
리턴 Symfony\Component\EventDispatcher\Event The Event instance

removeListener() 공개 메소드

또한 보기: EventDispatcherInterface::removeListener
public removeListener ( $eventName, $listener )

removeSubscriber() 공개 메소드

또한 보기: EventDispatcherInterface::removeSubscriber
public removeSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
$subscriber Symfony\Component\EventDispatcher\EventSubscriberInterface