Varien_Event Class Reference

Inheritance diagram for Varien_Event:

Varien_Object

List of all members.

Public Member Functions

 __construct (array $data=array())
 getObservers ()
 addObserver (Varien_Event_Observer $observer)
 removeObserverByName ($observerName)
 dispatch ()
 getName ()
 setName ($data)
 getBlock ()

Protected Attributes

 $_observers


Detailed Description

Definition at line 35 of file Event.php.


Constructor & Destructor Documentation

__construct ( array data = array()  ) 

Constructor

Initializes observers collection

Parameters:
array $data

Definition at line 51 of file Event.php.

00052     {
00053         $this->_observers = new Varien_Event_Observer_Collection();
00054         parent::__construct($data);
00055     }


Member Function Documentation

addObserver ( Varien_Event_Observer observer  ) 

Register an observer for the event

Parameters:
Varien_Event_Observer $observer
Returns:
Varien_Event

Definition at line 73 of file Event.php.

00074     {
00075         $this->getObservers()->addObserver($observer);
00076         return $this;
00077     }

dispatch (  ) 

Dispatches the event to registered observers

Returns:
Varien_Event

Definition at line 96 of file Event.php.

00097     {
00098         $this->getObservers()->dispatch($this);
00099         return $this;
00100     }

getBlock (  ) 

Definition at line 118 of file Event.php.

00119     {
00120         return $this->_getData('block');
00121     }

getName (  ) 

Retrieve event name

Returns:
string

Definition at line 107 of file Event.php.

00108     {
00109         return isset($this->_data['name']) ? $this->_data['name'] : null;
00110     }

getObservers (  ) 

Returns all the registered observers for the event

Returns:
Varien_Event_Observer_Collection

Definition at line 62 of file Event.php.

00063     {
00064         return $this->_observers;
00065     }

removeObserverByName ( observerName  ) 

Removes an observer by its name

Parameters:
string $observerName
Returns:
Varien_Event

Definition at line 85 of file Event.php.

00086     {
00087         $this->getObservers()->removeObserverByName($observerName);
00088         return $this;
00089     }

setName ( data  ) 

Definition at line 112 of file Event.php.

00113     {
00114         $this->_data['name'] = $data;
00115         return $this;
00116     }


Member Data Documentation

$_observers [protected]

Definition at line 42 of file Event.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:25:01 2009 for Magento by  doxygen 1.5.8