Thruway\Role\Dealer::managerGetRegistrations PHP Method

managerGetRegistrations() public method

todo: this may be used by testing
public managerGetRegistrations ( ) : array
return array
    public function managerGetRegistrations()
    {
        $theRegistrations = [];
        /* @var $procedure \Thruway\Procedure */
        foreach ($this->procedures as $procedure) {
            /* @var $registration \Thruway\Registration */
            foreach ($procedure->getRegistrations() as $registration) {
                $theRegistrations[] = ["id" => $registration->getId(), "name" => $registration->getProcedureName(), "session" => $registration->getSession()->getSessionId(), "statistics" => $registration->getStatistics()];
            }
        }
        return [$theRegistrations];
    }

Usage Example

Example #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();
     });
 }