Public Member Functions | |
isValidFor (Varien_Event $event) | |
dispatch (Varien_Event $event) | |
getName () | |
setName ($data) | |
getEventName () | |
setEventName ($data) | |
getCallback () | |
setCallback ($data) | |
getEvent () | |
setEvent ($data) |
Definition at line 35 of file Observer.php.
dispatch | ( | Varien_Event $ | event | ) |
Dispatches an event to observer's callback
Varien_Event | $event |
Definition at line 54 of file Observer.php.
00055 { 00056 if (!$this->isValidFor($event)) { 00057 return $this; 00058 } 00059 00060 $callback = $this->getCallback(); 00061 $this->setEvent($event); 00062 00063 $_profilerKey = 'OBSERVER: '.(is_object($callback[0]) ? get_class($callback[0]) : (string)$callback[0]).' -> '.$callback[1]; 00064 Varien_Profiler::start($_profilerKey); 00065 call_user_func($callback, $this); 00066 Varien_Profiler::stop($_profilerKey); 00067 00068 return $this; 00069 }
getCallback | ( | ) |
Definition at line 91 of file Observer.php.
00092 { 00093 return $this->getData('callback'); 00094 }
getEvent | ( | ) |
Get observer event object
Definition at line 106 of file Observer.php.
00107 { 00108 return $this->getData('event'); 00109 }
getEventName | ( | ) |
Definition at line 81 of file Observer.php.
00082 { 00083 return $this->getData('event_name'); 00084 }
getName | ( | ) |
isValidFor | ( | Varien_Event $ | event | ) |
Checkes the observer's event_regex against event's name
Varien_Event | $event |
Reimplemented in Varien_Event_Observer_Cron, and Varien_Event_Observer_Regex.
Definition at line 43 of file Observer.php.
00044 { 00045 return $this->getEventName()===$event->getName(); 00046 }
setCallback | ( | $ | data | ) |
setEvent | ( | $ | data | ) |
setEventName | ( | $ | data | ) |
setName | ( | $ | data | ) |