PHP 클래스 Elgg\HooksRegistrationService

Use the elgg_* versions instead.
부터: 1.9.0
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$logger Logger

공개 메소드들

메소드 설명
backup ( ) : void Temporarily remove all event/hook registrations (before tests)
clearHandlers ( string $name, string $type ) : void Clears all handlers for a specific hook
getAllHandlers ( ) : array Returns all registered handlers as array( $name => array( $type => array( $priority => array( callback, callback, ) ) )
getOrderedHandlers ( string $name, string $type ) : callable[] Returns an ordered array of handlers registered for $name and $type.
hasHandler ( string $name, string $type ) : boolean Is a handler registered for this specific name and type? "all" handlers are not considered.
registerHandler ( $name, $type, $callback, $priority = 500 ) Registers a handler.
restore ( ) : void Restore backed up event/hook registrations (after tests)
setLogger ( Logger $logger = null ) : self Set a logger instance, e.g. for reporting uncallable handlers
unregisterHandler ( string $name, string $type, callable $callback ) : boolean Unregister a handler

보호된 메소드들

메소드 설명
getMatcher ( callable $spec ) : elgg\MethodMatcher | null Create a matcher for the given callable (if it's for a static or dynamic method)

메소드 상세

backup() 공개 메소드

Call backup() before your tests and restore() after.
또한 보기: restore
public backup ( ) : void
리턴 void

clearHandlers() 공개 메소드

Clears all handlers for a specific hook
public clearHandlers ( string $name, string $type ) : void
$name string
$type string
리턴 void

getAllHandlers() 공개 메소드

Returns all registered handlers as array( $name => array( $type => array( $priority => array( callback, callback, ) ) )
public getAllHandlers ( ) : array
리턴 array

getMatcher() 보호된 메소드

Create a matcher for the given callable (if it's for a static or dynamic method)
protected getMatcher ( callable $spec ) : elgg\MethodMatcher | null
$spec callable Callable we're creating a matcher for
리턴 elgg\MethodMatcher | null

getOrderedHandlers() 공개 메소드

Returns an ordered array of handlers registered for $name and $type.
또한 보기: Elgg\HooksRegistrationService::getAllHandlers()
public getOrderedHandlers ( string $name, string $type ) : callable[]
$name string The name of the hook
$type string The type of the hook
리턴 callable[]

hasHandler() 공개 메소드

If you need to consider "all" handlers, you must check them independently, or use (bool)elgg_get_ordered_hook_handlers().
public hasHandler ( string $name, string $type ) : boolean
$name string The name of the hook
$type string The type of the hook
리턴 boolean

registerHandler() 공개 메소드

Registers a handler.
public registerHandler ( $name, $type, $callback, $priority = 500 )

restore() 공개 메소드

Restore backed up event/hook registrations (after tests)
또한 보기: backup
public restore ( ) : void
리턴 void

setLogger() 공개 메소드

Set a logger instance, e.g. for reporting uncallable handlers
public setLogger ( Logger $logger = null ) : self
$logger Logger The logger
리턴 self

unregisterHandler() 공개 메소드

Unregister a handler
public unregisterHandler ( string $name, string $type, callable $callback ) : boolean
$name string
$type string
$callback callable
리턴 boolean

프로퍼티 상세

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

protected Logger,Elgg $logger
리턴 Logger