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

Returns a reference to the plugin instance that created the event.
public getPlugin ( ) : Phergie_Plugin_Abstract | null
Результат Phergie_Plugin_Abstract | null Plugin instance or NULL if none has been set
Пример #1
0
 /**
  * Tests that a plugin can be associated with an event.
  *
  * @return void
  */
 public function testSetPlugin()
 {
     $plugin = $this->getMock('Phergie_Plugin_Abstract');
     $this->event->setPlugin($plugin);
     $this->assertSame($plugin, $this->event->getPlugin());
 }
Пример #2
0
 /**
  * Assert that the emitter of the given command event was the given
  * plugin
  *
  * @param Phergie_Event_Command   $event
  * @param Phergie_Plugin_Abstract $plugin
  * @param string                  $message
  */
 public function assertEventEmitter(Phergie_Event_Command $event, Phergie_Plugin_Abstract $plugin, $message = null)
 {
     $this->assertSame($plugin, $event->getPlugin(), $message);
 }
Пример #3
0
 /**
  * Outputs a prompt when the bot sends a command to a server.
  *
  * @param Phergie_Event_Command $event      Event representing the 
  *        command being sent
  * @param Phergie_Connection    $connection Connection on which the 
  *        command is being sent 
  *
  * @return void
  */
 public function onCommand(Phergie_Event_Command $event, Phergie_Connection $connection)
 {
     $plugin = $event->getPlugin()->getName();
     $host = $connection->getHostmask()->getHost();
     $type = strtoupper($event->getType());
     $args = implode(' ', $event->getArguments());
     $this->console($plugin . ' plugin: ' . $host . ' -> ' . $type . ' ' . $args);
 }