Phergie_Ui_Abstract::onCommand PHP Метод

onCommand() публичный Метод

Handler for when the bot sends a command to a server.
public onCommand ( Phergie_Event_Command $event, Phergie_Connection $connection ) : void
$event Phergie_Event_Command Event representing the command being sent
$connection Phergie_Connection Connection on which the command is being sent
Результат void
    public function onCommand(Phergie_Event_Command $event, Phergie_Connection $connection)
    {
    }

Usage Example

Пример #1
0
 /**
  * Sends resulting outgoing events from earlier processing in handleEvents().
  *
  * @param Phergie_Connection $connection Active connection
  *
  * @return void
  */
 protected function processEvents(Phergie_Connection $connection)
 {
     $this->plugins->preDispatch();
     if (count($this->events)) {
         foreach ($this->events as $event) {
             $this->ui->onCommand($event, $connection);
             $method = 'do' . ucfirst(strtolower($event->getType()));
             call_user_func_array(array($this->driver, $method), $event->getArguments());
         }
     }
     $this->plugins->postDispatch();
     if ($this->events->hasEventOfType(Phergie_Event_Request::TYPE_QUIT)) {
         $this->ui->onQuit($connection);
         $this->connections->removeConnection($connection);
     }
     $this->events->clearEvents();
 }