PHP 트레잇 PHPDaemon\Traits\EventHandlers

저자: Vasily Zorin ([email protected])
파일 보기 프로젝트 열기: kakserpom/phpdaemon

보호된 프로퍼티들

프로퍼티 타입 설명
$addThisToEvents Unshift $this to arguments of callback?
$eventHandlers Event handlers
$lastEventName Last called event name

공개 메소드들

메소드 설명
bind ( string | array $event, callable $cb ) : this Bind event or events
event ( string $name, $args ) : this Propagate event
getLastEventName ( ) : string Use it to define event name, when one callback was bind to more than one events
off ( string | array $event, callable $cb = null ) : this Unbind event(s) or callback from event(s)
on ( string | array $event, callable $cb ) : this Bind event or events
trigger ( string $name, $args ) : this Propagate event
triggerAndCount ( string $name, $args ) : integer Propagate event
unbind ( string | array $event, callable $cb = null ) : this Unbind event(s) or callback from event(s)

보호된 메소드들

메소드 설명
cleanupEventHandlers ( ) : void Clean up all events

메소드 상세

bind() 공개 메소드

Bind event or events
public bind ( string | array $event, callable $cb ) : this
$event string | array Event name
$cb callable Callback
리턴 this

cleanupEventHandlers() 보호된 메소드

Clean up all events
protected cleanupEventHandlers ( ) : void
리턴 void

event() 공개 메소드

Propagate event
public event ( string $name, $args ) : this
$name string Event name
$args Arguments
리턴 this

getLastEventName() 공개 메소드

Use it to define event name, when one callback was bind to more than one events
public getLastEventName ( ) : string
리턴 string

off() 공개 메소드

Unbind event(s) or callback from event(s)
public off ( string | array $event, callable $cb = null ) : this
$event string | array Event name
$cb callable Callback, optional
리턴 this

on() 공개 메소드

Bind event or events
public on ( string | array $event, callable $cb ) : this
$event string | array Event name
$cb callable Callback
리턴 this

trigger() 공개 메소드

Propagate event
public trigger ( string $name, $args ) : this
$name string Event name
$args Arguments
리턴 this

triggerAndCount() 공개 메소드

Propagate event
public triggerAndCount ( string $name, $args ) : integer
$name string Event name
$args Arguments
리턴 integer

unbind() 공개 메소드

Unbind event(s) or callback from event(s)
public unbind ( string | array $event, callable $cb = null ) : this
$event string | array Event name
$cb callable Callback, optional
리턴 this

프로퍼티 상세

$addThisToEvents 보호되어 있는 프로퍼티

Unshift $this to arguments of callback?
protected $addThisToEvents

$eventHandlers 보호되어 있는 프로퍼티

Event handlers
protected $eventHandlers

$lastEventName 보호되어 있는 프로퍼티

Last called event name
protected $lastEventName