Пример #1
0
 /**
  * Send/fire a bucket to a listener.
  *
  * @param   string             $listenerId    Listener ID.
  * @param   \Hoa\Event\Bucket  $data          Data.
  * @return  array
  * @throws  \Hoa\Event\Exception
  */
 public function fire($listenerId, Bucket $data)
 {
     if (false === $this->listenerExists($listenerId)) {
         throw new Exception('Cannot fire on %s because it is not defined.', 1, $listenerId);
     }
     $data->setSource($this->_source);
     $out = [];
     foreach ($this->_callables[$listenerId] as $callable) {
         $out[] = $callable($data);
     }
     return $out;
 }