Thruway\Role\Dealer::processUnregister PHP Method

processUnregister() private method

process UnregisterMessage
private processUnregister ( Session $session, Thruway\Message\UnregisterMessage $msg )
$session Thruway\Session
$msg Thruway\Message\UnregisterMessage
    private function processUnregister(Session $session, UnregisterMessage $msg)
    {
        $registration = $this->getRegistrationById($msg->getRegistrationId());
        if ($registration && $this->procedures[$registration->getProcedureName()]) {
            $procedure = $this->procedures[$registration->getProcedureName()];
            if ($procedure) {
                if ($procedure->processUnregister($session, $msg)) {
                    // Unregistration was successful - remove from this sessions
                    // list of registrations
                    if ($this->registrationsBySession->contains($session) && in_array($procedure, $this->registrationsBySession[$session])) {
                        $registrationsInSession = $this->registrationsBySession[$session];
                        array_splice($registrationsInSession, array_search($procedure, $registrationsInSession), 1);
                    }
                }
            }
            return;
        }
        // apparently we didn't find anything to unregister
        $session->sendMessage(ErrorMessage::createErrorMessageFromMessage($msg, 'wamp.error.no_such_procedure'));
    }