Zeta Components Manual :: Docs For Class ezcSignalStaticConnections
SignalSlot::ezcSignalStaticConnections
Class ezcSignalStaticConnections
ezcSignalStaticConnections makes it possible to connect to signals through the signals identifier.
The static connections allow you to:
- connect to a signal sent by any object signal collection with the same identifier. Usually the identifier is set to the name of the class holding the collection. Using the static connections you can connect to a signal sent by any object of that class.
- connect to a signal that does not yet exist. This allows you to delay initialization of the emitting object until it is needed.
Source for this file: /SignalSlot/src/static_connections.php
Implements interfaces:
Version: | //autogen// |
Properties
array | read/write |
$connections
Holds the internal structure of signals. The format is array( identifier => array( signalName => array(priority=>array(slots)) ) ). It can be both read and set in order to provide easy setup of the static connections from disk. |
Method Summary
public static ezcConfigurationManager |
getInstance(
)
Returns the instance of the ezcSignalStaticConnections.. |
public void |
connect(
$identifier
, $signal
, $slot
, [ $priority
= 1000] )
Connects the signal $signal emited by any ezcSignalCollection with the identifier $identifier to the slot $slot. |
public void |
disconnect(
$identifier
, $signal
, $slot
, [ $priority
= null] )
Disconnects the $slot from the $signal with identifier $identifier.. |
public array(int=>array(callback)) |
getConnections(
$identifier
, $signal
)
Returns all the connections for signals $signal in signal collections with the identifier $identifier. |
public mixed |
__get(
$name
)
Returns the property $name. |
public void |
__set(
$name
, $value
)
Sets the property $name to $value. |
Methods
getInstance
Returns the instance of the ezcSignalStaticConnections..
connect
Connects the signal $signal emited by any ezcSignalCollection with the identifier $identifier to the slot $slot.
To control the order in which slots are called you can set a priority from 1 - 65 536. The lower the number the higher the priority. The default priority is 1000. Slots with the same priority may be called with in any order.
A slot will be called once for every time it is connected. It is possible to connect a slot more than once.
See the PHP documentation for examples on the callback type. http://php.net/callback
We reccommend avoiding excessive usage of the $priority parameter since it makes it much harder to track how your program works.
Parameters:
Name | Type | Description |
---|---|---|
$identifier |
string | |
$signal |
string | |
$slot |
callback | |
$priority |
int |
disconnect
Disconnects the $slot from the $signal with identifier $identifier..
If the priority is given it will try to disconnect a slot with that priority. If no such slot is found no slot will be disconnected.
If no priority is given it will disconnect the matching slot with the lowest priority.
Parameters:
Name | Type | Description |
---|---|---|
$identifier |
string | |
$signal |
string | |
$slot |
callback | |
$priority |
int |
getConnections
Returns all the connections for signals $signal in signal collections with the identifier $identifier.
Parameters:
Name | Type | Description |
---|---|---|
$identifier |
string | |
$signal |
string |
Implementation of:
Method | Description |
---|---|
ezcSignalStaticConnectionsBase::getConnections() |
Returns all the connections for signals $signal in signal collections with the identifier $identifier. |
__get
Returns the property $name.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string |
Exceptions:
Type | Description |
---|---|
ezcBasePropertyNotFoundException |
if the property does not exist. |
__set
Sets the property $name to $value.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | |
$value |
mixed |
Exceptions:
Type | Description |
---|---|
ezcBasePropertyNotFoundException |
if the property does not exist. |