PHP Class Gc\Event\StaticEventManager

Inheritance: extends Zend\EventManager\SharedEventManager
Datei anzeigen Open project: gotcms/gotcms Class Usage Examples

Protected Properties

Property Type Description
$instance Zend\EventManager\SharedEventManagerInterface Retrieve StaticEventManager instance

Public Methods

Method Description
getEvent ( string $id ) : Zend\EventManager\EventManager Retrieve event
getInstance ( ) : Zend\EventManager\SharedEventManagerInterface Retrieve instance
hasInstance ( ) : boolean Is a singleton instance defined?
resetInstance ( ) : void Reset the singleton instance
setInstance ( Zend\EventManager\SharedEventManagerInterface $instance ) : void Set the singleton to a specific SharedEventManagerInterface instance
trigger ( string $id, string $event, string | object $target = null, array | ArrayAccess $argv = [], null | callable $callback = null ) : Zend\EventManager\ResponseCollection Trigger all listeners for a given event

Method Details

getEvent() public method

Retrieve event
public getEvent ( string $id ) : Zend\EventManager\EventManager
$id string Id
return Zend\EventManager\EventManager

getInstance() public static method

Retrieve instance
public static getInstance ( ) : Zend\EventManager\SharedEventManagerInterface
return Zend\EventManager\SharedEventManagerInterface

hasInstance() public static method

Is a singleton instance defined?
public static hasInstance ( ) : boolean
return boolean

resetInstance() public static method

Reset the singleton instance
public static resetInstance ( ) : void
return void

setInstance() public static method

Set the singleton to a specific SharedEventManagerInterface instance
public static setInstance ( Zend\EventManager\SharedEventManagerInterface $instance ) : void
$instance Zend\EventManager\SharedEventManagerInterface Event instance
return void

trigger() public method

Can emulate triggerUntil() if the last argument provided is a callback.
public trigger ( string $id, string $event, string | object $target = null, array | ArrayAccess $argv = [], null | callable $callback = null ) : Zend\EventManager\ResponseCollection
$id string Identifier(s) for event emitting component(s)
$event string Event
$target string | object Object calling emit, or symbol describing target (such as static method name)
$argv array | ArrayAccess Array of arguments; typically, should be associative
$callback null | callable Callback function
return Zend\EventManager\ResponseCollection All listener return values

Property Details

$instance protected_oe static_oe property

Retrieve StaticEventManager instance
protected static SharedEventManagerInterface,Zend\EventManager $instance
return Zend\EventManager\SharedEventManagerInterface