PHP Class Resque\Event

Author: Chris Boulton ([email protected])
Afficher le fichier Open project: mjphaynes/php-resque Class Usage Examples

Protected Properties

Свойство Type Description
$events containing all registered callbacks, indexed by event name

Méthodes publiques

Méthode Description
clear ( ) Clear all registered listeners.
eventName ( integer $event ) : string | false Returns the name of the given event from constant
fire ( string $event, mixed $data = null ) : true Raise a given event with the supplied data.
forget ( string $event, mixed $callback ) : true Stop a given callback from listening on a specific event.
listen ( string $event, mixed $callback ) : true Listen in on a given event to have a specified callback fired.

Method Details

clear() public static méthode

Clear all registered listeners.
public static clear ( )

eventName() public static méthode

Returns the name of the given event from constant
public static eventName ( integer $event ) : string | false
$event integer Event constant
Résultat string | false

fire() public static méthode

Raise a given event with the supplied data.
public static fire ( string $event, mixed $data = null ) : true
$event string Name of event to be raised
$data mixed Data that should be passed to each callback (optional)
Résultat true

forget() public static méthode

Stop a given callback from listening on a specific event.
public static forget ( string $event, mixed $callback ) : true
$event string Name of event
$callback mixed The callback as defined when listen() was called
Résultat true

listen() public static méthode

Listen in on a given event to have a specified callback fired.
public static listen ( string $event, mixed $callback ) : true
$event string Name of event to listen on.
$callback mixed Any callback callable by call_user_func_array
Résultat true

Property Details

$events protected_oe static_oe property

containing all registered callbacks, indexed by event name
protected static $events