Varien_Event_Observer_Collection Class Reference

List of all members.

Public Member Functions

 __construct ()
 getAllObservers ()
 getObserverByName ($observerName)
 addObserver (Varien_Event_Observer $observer)
 removeObserverByName ($observerName)
 dispatch (Varien_Event $event)

Protected Attributes

 $_observers


Detailed Description

Definition at line 35 of file Collection.php.


Constructor & Destructor Documentation

__construct (  ) 

Initializes observers

Definition at line 48 of file Collection.php.

00049     {
00050         $this->_observers = array();
00051     }


Member Function Documentation

addObserver ( Varien_Event_Observer observer  ) 

Adds an observer to the collection

Parameters:
Varien_Event_Observer $observer
Returns:
Varien_Event_Observer_Collection

Definition at line 80 of file Collection.php.

00081     {
00082         $this->_observers[$observer->getName()] = $observer;
00083         return $this;
00084     }

dispatch ( Varien_Event event  ) 

Dispatches an event to all observers in the collection

Parameters:
Varien_Event $event
Returns:
Varien_Event_Observer_Collection

Definition at line 104 of file Collection.php.

00105     {
00106         foreach ($this->_observers as $observer) {
00107             $observer->dispatch($event);
00108         }
00109         return $this;
00110     }

getAllObservers (  ) 

Returns all observers in the collection

Returns:
array

Definition at line 58 of file Collection.php.

00059     {
00060         return $this->_observers;
00061     }

getObserverByName ( observerName  ) 

Returns observer by its name

Parameters:
string $observerName
Returns:
Varien_Event_Observer

Definition at line 69 of file Collection.php.

00070     {
00071         return $this->_observers[$observerName];
00072     }

removeObserverByName ( observerName  ) 

Removes an observer from the collection by its name

Parameters:
string $observerName
Returns:
Varien_Event_Observer_Collection

Definition at line 92 of file Collection.php.

00093     {
00094         unset($this->_observers[$observerName]);
00095         return $this;
00096     }


Member Data Documentation

$_observers [protected]

Definition at line 42 of file Collection.php.


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

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