code = (int)$code; $this->login = $login; $this->tokenAuth = $tokenAuth; } /** * Returns the login used to authenticate. * * @return string */ public function getIdentity() { return $this->login; } /** * Returns the token_auth to authenticate the current user in the API * * @return string */ public function getTokenAuth() { return $this->tokenAuth; } /** * Returns the authentication result code. * * @return int */ public function getCode() { return $this->code; } /** * Returns true if the user has Super User access, false otherwise. * * @return bool */ public function hasSuperUserAccess() { return $this->getCode() == self::SUCCESS_SUPERUSER_AUTH_CODE; } /** * Returns true if this result was successfully authentication. * * @return bool */ public function wasAuthenticationSuccessful() { return $this->code > self::FAILURE; } }