/** * Returns the name of corresponding PHP script for the specified query. * * @param \Fine47\MicroRouter\Interfaces\Query $query to return its script * @return string name of corresponding PHP script */ protected function getFilterScriptName(Interfaces\Query $query) { return strtolower($query->getMethod()) . '.filters.php'; }
/** * Decodes the query's body and return it as JSON object. * * @param \Fine47\MicroRouter\Interfaces\Query $query to decode * @return array|FALSE decoded JSON data, FALSE on error */ protected function getQueryData(Interfaces\Query $query) { return Util\Json::decode($query->getRawBody()); }
/** * Returns the submitted parameters of the specified query. * * @param \Fine47\MicroRouter\Interfaces\Query $query to decode * @return array|FALSE submitted parameters, FALSE on error */ protected function getQueryData(Interfaces\Query $query) { if ($query instanceof Requests\HttpJson) { return $query->getBody(); } return false; }