Path

ez components / documentation / api reference / 2006.2 / signalslot


eZ Components 2006.2

SignalSlot: ezcSignalCollection

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcSignalCollection

ezcSignalCollection implements a mechanism for inter and intra object communication. [source]
TODO: examples

Properties

string read  $identifier
The identifier of this signal collection. Usually the class name of the object containing the collection.
bool read/write  $signalsBlocked
If set to true emits will not cause any slots to be called.

Method Summary

public ezcSignalCollection __construct( [$identifier = "default"] )
Constructs a new signal collection with the identifier $identifier.
public void connect( $signal, $slot, [$priority = 1000] )
Connects the signal $signal to the slot $slot.
public void disconnect( $signal, $slot, [$priority = null] )
Disconnects the $slot from the $signal.
public void emit( $signal, 1 )
Emits the signal with the name $signal
public static ezcSignalStaticConnectionsBase getStaticConnectionsHolder( )
Returns the current provider of static connections or NULL if there is none.
public static void setStaticConnectionsHolder( $holder )
If set, $holder will be used to fetch static connections instead of ezcSignalStaticConnections.
public mixed __get( $name )
Returns the property $name.
public void __set( $name, $value )
Sets the property $name to $value.

Methods

__construct

ezcSignalCollection __construct( [string $identifier = "default"] )
Constructs a new signal collection with the identifier $identifier.
The identifier can be used to connect to signals statically using ezcSignalStaticConnections.

Parameters

Name Type Description
$identifier string  

connect

void connect( string $signal, callback $slot, [mixed $priority = 1000] )
Connects the signal $signal 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
$signal string  
$slot callback  

disconnect

void disconnect( string $signal, callback $slot, [mixed $priority = null] )
Disconnects the $slot from the $signal.
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
$signal string  
$slot callback  

emit

void emit( string $signal, ... 1 )
Emits the signal with the name $signal
Any additional parameters are sent as parameters to the slot.

Parameters

Name Type Description
$signal string  
1 ... signal parameters

getStaticConnectionsHolder

ezcSignalStaticConnectionsBase getStaticConnectionsHolder( )
Returns the current provider of static connections or NULL if there is none.

setStaticConnectionsHolder

void setStaticConnectionsHolder( $holder )
If set, $holder will be used to fetch static connections instead of ezcSignalStaticConnections.

__get

mixed __get( string $name )
Returns the property $name.

Parameters

Name Type Description
$name string  

Throws

ClassDescription
ezcBasePropertyNotFoundException if the property does not exist.

__set

void __set( string $name, mixed $value )
Sets the property $name to $value.

Parameters

Name Type Description
$name string  
$value mixed  

Throws

ClassDescription
ezcBasePropertyNotFoundException if the property does not exist.

Last updated: Thu, 01 Nov 2007