프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$container | The container this event dispatcher is attached to | ||
$events | Maps events to observers | ||
$observers | The observers attached to the dispatcher |
메소드 | 설명 | |
---|---|---|
__construct ( |
Public constructor | |
attach ( |
Attaches an observer to the object | |
chainHandle ( string $event, array $args = [] ) : mixed | Asks each observer to handle an event based on the provided arguments. The first observer to return a non-null result wins. This is a *very* simplistic implementation of the Chain of Command pattern. | |
detach ( |
Detaches an observer from the object | |
getContainer ( ) : |
Returns the container this event dispatcher is attached to | |
getObserverByClass ( string $className ) : null | |
Returns an observer attached to this behaviours dispatcher by its class name | |
hasObserver ( |
Is an observer object already registered with this dispatcher? | |
hasObserverClass ( string $className ) : boolean | Is there an observer of the specified class already registered with this dispatcher? | |
trigger ( string $event, array $args = [] ) : array | Triggers an event in the attached observers |
public __construct ( |
||
$container | The container this event dispatcher is attached to |
public attach ( |
||
$observer | The observer to attach | |
리턴 | Ourselves, for chaining |
public detach ( |
||
$observer | The observer to detach | |
리턴 | Ourselves, for chaining |
public getContainer ( ) : |
||
리턴 |
public getObserverByClass ( string $className ) : null | |
||
$className | string | The class name of the observer object to return |
리턴 | null | |
public hasObserver ( |
||
$observer | The observer to check if it's attached | |
리턴 | boolean |
public hasObserverClass ( string $className ) : boolean | ||
$className | string | The observer class name to check if it's attached |
리턴 | boolean |