Drahak\Restful\Application\Routes\ResourceRoute::match PHP Method

match() public method

public match ( Nette\Http\IRequest $httpRequest ) : Nette\Application\Request | null
$httpRequest Nette\Http\IRequest
return Nette\Application\Request | null
    public function match(Http\IRequest $httpRequest)
    {
        $appRequest = parent::match($httpRequest);
        if (!$appRequest) {
            return NULL;
        }
        // Check requested method
        $methodFlag = $this->getMethod($httpRequest);
        if (!$this->isMethod($methodFlag)) {
            return NULL;
        }
        // If there is action dictionary, set method
        if ($this->actionDictionary) {
            $parameters = $appRequest->getParameters();
            $parameters['action'] = $this->actionDictionary[$methodFlag];
            $parameters['action'] = self::formatActionName($this->actionDictionary[$methodFlag], $parameters);
            $appRequest->setParameters($parameters);
        }
        return $appRequest;
    }