Пример #1
0
 /**
  * Dispatch hook listeners.
  *
  * @param string $name Hook event name.
  * @param Hook   $hook Hook instance.
  *
  * @return Hook
  */
 public function dispatch($name, Hook $hook)
 {
     if (!$this->loaded) {
         // lazy load handlers for the first time
         $this->loadRuntimeHandlers();
         $this->loaded = true;
     }
     $hook->setName($name);
     $this->decorateHook($hook);
     if (!$hook->getAreaId()) {
         return $hook;
     }
     return $this->dispatcher->dispatch($name, $hook);
 }