src/php/main/Eix/Core/Responders/Http.php
final public function getResponse()
    {
        if (empty($this->response)) {
            $httpMethod = $this->getRequest()
                ? strtoupper($this->getRequest()->getMethod())
                : 'GET'
            ;

            if ($this->isHttpMethodSupported($httpMethod)) {
                $functionName = $this->getFunctionName($httpMethod);
                Logger::get()->debug("Running responder method '$functionName'...");
                // If the responder is a restricted one...
                if ($this instanceof \Eix\Core\Responders\Restricted) {
                    // ... ensure the user is allowed to use that function.
                    Users::getCurrent()->checkAuthorisation($this, $functionName);
                }

                // The response is the result of executing the appropriate
                // responder function.
                $this->response = $this->$functionName();
            } else {
                throw new \Eix\Services\Net\Http\MethodNotAllowedException("This responder does not support {$httpMethod} requests.");
            }
        }

        return $this->response;
    }
final public function getResponse()
    {
        if (empty($this->response)) {
            $httpMethod = $this->getRequest()
                ? strtoupper($this->getRequest()->getMethod())
                : 'GET'
            ;

            if ($this->isHttpMethodSupported($httpMethod)) {
                $functionName = $this->getFunctionName($httpMethod);
                Logger::get()->debug("Running responder method '$functionName'...");
                // If the responder is a restricted one...
                if ($this instanceof \Eix\Core\Responders\Restricted) {
                    // ... ensure the user is allowed to use that function.
                    Users::getCurrent()->checkAuthorisation($this, $functionName);
                }

                // The response is the result of executing the appropriate
                // responder function.
                $this->response = $this->$functionName();
            } else {
                throw new \Eix\Services\Net\Http\MethodNotAllowedException("This responder does not support {$httpMethod} requests.");
            }
        }

        return $this->response;
    }
final public function getResponse ( ) { if ( empty ( $ this -> response ) ) { $ httpMethod = $ this -> getRequest ( ) ? strtoupper ( $ this -> getRequest ( ) -> getMethod ( ) ) : 'GET' ; if ( $ this -> isHttpMethodSupported ( $ httpMethod ) ) { $ functionName = $ this -> getFunctionName ( $ httpMethod ) ; Logger :: get ( ) -> debug ( "Running responder method '$functionName'..." ) ; // If the responder is a restricted one... if ( $ this instanceof \ Eix \ Core \ Responders \ Restricted ) { // ... ensure the user is allowed to use that function. Users :: getCurrent ( ) -> checkAuthorisation ( $ this , $ functionName ) ; } // The response is the result of executing the appropriate // responder function. $ this -> response = $ this -> $ functionName ( ) ; } else { throw new \ Eix \ Services \ Net \ Http \ MethodNotAllowedException ( "This responder does not support {$httpMethod} requests." ) ; } } return $ this -> response ; }
The default behaviour consists of executing a function named after the
HTTP method and the eventual action contained in the request, to produce
a Response object.

@return \Eix\Core\Response
@throws \Eix\Core\Exception
The default behaviour consists of executing a function named after the HTTP method and the eventual action contained in the request to produce a Response object .