Inheritance: extends AbstractRole
Esempio n. 1
0
 /**
  * Set manager
  *
  * @param \Thruway\Manager\ManagerInterface $manager
  */
 public function setManager($manager)
 {
     $this->manager = $manager;
     $this->broker->setManager($manager);
     $this->dealer->setManager($manager);
     $manager->addCallable("realm.{$this->getRealmName()}.registrations", function () {
         return $this->dealer->managerGetRegistrations();
     });
 }
Esempio n. 2
0
 /**
  * @param StateHandlerRegistration $stateHandlerRegistration
  */
 private function mapNewStateHandlerRegistration($stateHandlerRegistration)
 {
     $subscriptionGroups = $this->broker->getSubscriptionGroups();
     /** @var SubscriptionGroup $subscriptionGroup */
     foreach ($subscriptionGroups as $subscriptionGroup) {
         // only check groups without an existing state handler
         if (!$this->stateHandlerMap->contains($subscriptionGroup) || $this->stateHandlerMap->contains($subscriptionGroup) && $this->stateHandlerMap[$subscriptionGroup] === null) {
             if ($stateHandlerRegistration->handlesStateFor($subscriptionGroup)) {
                 $this->stateHandlerMap[$subscriptionGroup] = $stateHandlerRegistration;
             }
         }
     }
 }