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

Get registration ID
public getId ( ) : mixed
Результат mixed
Пример #1
0
 /**
  * @param CallMessage $msg
  * @param Registration $registration
  * @return static
  */
 static function createMessageFrom(CallMessage $msg, Registration $registration)
 {
     $requestId = Session::getUniqueId();
     $details = new \stdClass();
     return new static($requestId, $registration->getId(), $details, $msg->getArguments(), $msg->getArgumentsKw());
 }
Пример #2
0
 /**
  * Add registration
  *
  * @param \Thruway\Registration $registration
  * @return bool
  * @throws \Exception
  */
 private function addRegistration(Registration $registration, RegisterMessage $msg)
 {
     try {
         // make sure the uri is exactly the same
         if ($registration->getProcedureName() != $this->getProcedureName()) {
             throw new \Exception('Attempt to add registration to procedure with different procedure name.');
         }
         // make sure options match
         if ($registration->getAllowMultipleRegistrations() != $this->getAllowMultipleRegistrations()) {
             throw new \Exception('Registration and procedure must agree on allowing multiple registrations');
         }
         if ($registration->getDiscloseCaller() != $this->getDiscloseCaller()) {
             throw new \Exception('Registration and procedure must agree on disclose caller');
         }
         $this->registrations[] = $registration;
         $registration->getSession()->sendMessage(new RegisteredMessage($msg->getRequestId(), $registration->getId()));
         // now that we have added a new registration, process the queue if we are using it
         if ($this->getAllowMultipleRegistrations()) {
             $this->processQueue();
         }
         return true;
     } catch (\Exception $e) {
         $registration->getSession()->sendMessage(ErrorMessage::createErrorMessageFromMessage($msg));
         return false;
     }
 }