APIProject::fetch PHP Method

fetch() public method

public fetch ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
return SS_HTTPResponse
    public function fetch(\SS_HTTPRequest $request)
    {
        if (!$this->record->canView($this->getMember())) {
            return $this->message('You are not authorized to do that on this environment', 403);
        }
        switch ($request->httpMethod()) {
            case 'GET':
                return $this->getFetch($this->getRequest()->param('ID'));
            case 'POST':
                return $this->createFetch();
            default:
                return $this->message('API not found', 404);
        }
    }