public static processRequest ( string $method, array $paramOverride = [], array $defaultRequest = null ) : mixed | ||
$method | string | The API method to call, ie, `'Actions.getPageTitles'`. |
$paramOverride | array | The parameter name-value pairs to use instead of what's in `$_GET` & `$_POST`. |
$defaultRequest | array | Default query parameters. If a query parameter is absent in `$request`, it will be loaded from this. Defaults to `$_GET + $_POST`. To avoid using any parameters from $_GET or $_POST, set this to an empty `array()`. |
리턴 | mixed | The result of the API request. See {@link process()}. |
public static function processRequest($method, $paramOverride = array(), $defaultRequest = null)
{
$params = array();
$params['format'] = 'original';
$params['serialize'] = '0';
$params['module'] = 'API';
$params['method'] = $method;
$params = $paramOverride + $params;
// process request
$request = new Request($params, $defaultRequest);
return $request->process();
}
protected function getContentNames($websiteId = null, $date = null) { if (!is_null($websiteId)) { return \Piwik\API\Request::processRequest('Contents.getContentNames', array('idSite' => $websiteId, 'period' => 'year', 'date' => $date)); } return Db::fetchAssoc("select `idaction`, `name` from `{$this->tablePrefix}log_action` where `type` = ?", array(\Piwik\Tracker\Action::TYPE_CONTENT_NAME)); }