Fabiang\Xmpp\Options::getImplementation PHP Method

getImplementation() public method

Get protocol implementation.
public getImplementation ( ) : Fabiang\Xmpp\Protocol\ImplementationInterface
return Fabiang\Xmpp\Protocol\ImplementationInterface
    public function getImplementation()
    {
        if (null === $this->implementation) {
            $this->setImplementation(new DefaultImplementation());
        }
        return $this->implementation;
    }

Usage Example

Example #1
0
 /**
  * Setup implementation.
  *
  * @return void
  */
 protected function setupImplementation()
 {
     $this->connection->setEventManager($this->eventManager);
     $this->connection->setOptions($this->options);
     $implementation = $this->options->getImplementation();
     $implementation->setEventManager($this->eventManager);
     $implementation->setOptions($this->options);
     $implementation->register();
     $implementation->registerListener(new Logger());
 }