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

public addRealmSubscriber ( Thruway\Module\RealmModuleInterface $subscriber )
$subscriber Thruway\Module\RealmModuleInterface
Пример #1
0
 /**
  * Constructor
  *
  * @param \Thruway\Transport\TransportInterface $transport
  */
 public function __construct(TransportInterface $transport)
 {
     $this->transport = $transport;
     $this->state = static::STATE_PRE_HELLO;
     $this->sessionId = Utils::getUniqueId();
     $this->realm = null;
     $this->sessionStart = new \DateTime();
     $this->authenticationDetails = null;
     $this->dispatcher = new EventDispatcher();
     $this->dispatcher->addRealmSubscriber($this);
 }
Пример #2
0
 /**
  * Constructor
  *
  * @param \Thruway\Transport\TransportInterface $transport
  * @param \Thruway\Manager\ManagerInterface $manager
  */
 public function __construct(TransportInterface $transport, ManagerInterface $manager = null)
 {
     $this->transport = $transport;
     $this->state = static::STATE_PRE_HELLO;
     $this->sessionId = Utils::getUniqueId();
     $this->realm = null;
     $this->messagesSent = 0;
     $this->sessionStart = new \DateTime();
     $this->authenticationDetails = null;
     $this->pendingCallCount = 0;
     $this->dispatcher = new EventDispatcher();
     $this->dispatcher->addRealmSubscriber($this);
     if ($manager === null) {
         $manager = new ManagerDummy();
     }
     $this->setManager($manager);
 }