/** * * @param string $name Event name * @param array $data Data to be passed to object * * @return void */ public function emit(Bvb_Grid_Event $event) { if (isset($this->_listeners[$event->getName()])) { $code = $this->_listeners[$event->getName()]; $priority = array(); foreach ($code as $key => $pri) { $priority[$key] = $pri['priority']; } array_multisort($priority, SORT_ASC, $code); foreach ($code as $callback) { $eventParams = array_merge_recursive($event->getParams(), $callback['params']); $event->setParams($eventParams); call_user_func($callback['callback'], $event); } } }