本文整理汇总了PHP中Piwik_API_Request::getRequestArrayFromString方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_API_Request::getRequestArrayFromString方法的具体用法?PHP Piwik_API_Request::getRequestArrayFromString怎么用?PHP Piwik_API_Request::getRequestArrayFromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_API_Request
的用法示例。
在下文中一共展示了Piwik_API_Request::getRequestArrayFromString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postDataTableLoadedFromAPI
/**
* Hook called after the dataTable has been loaded from the API
* Can be used to add, delete or modify the data freshly loaded
*/
protected function postDataTableLoadedFromAPI()
{
if (empty($this->dataTable)) {
return false;
}
// First, filters that delete rows
foreach ($this->queuedFiltersPriority as $filter) {
$filterName = $filter[0];
$filterParameters = $filter[1];
$this->dataTable->filter($filterName, $filterParameters);
}
if (0 == Piwik_Common::getRequestVar('disable_generic_filters', '0', 'string')) {
// Second, generic filters (Sort, Limit, Replace Column Names, etc.)
$requestString = $this->getRequestString();
$request = Piwik_API_Request::getRequestArrayFromString($requestString);
if (!empty($this->variablesDefault['enable_sort']) && $this->variablesDefault['enable_sort'] === 'false') {
$request['filter_sort_column'] = $request['filter_sort_order'] = '';
}
$genericFilter = new Piwik_API_DataTableGenericFilter($request);
$genericFilter->filter($this->dataTable);
}
// Finally, apply datatable filters that were queued (should be 'presentation' filters that do not affect the number of rows)
foreach ($this->queuedFilters as $filter) {
$filterName = $filter[0];
$filterParameters = $filter[1];
$this->dataTable->filter($filterName, $filterParameters);
}
}
示例2: postDataTableLoadedFromAPI
/**
* Hook called after the dataTable has been loaded from the API
* Can be used to add, delete or modify the data freshly loaded
*
* @return bool
*/
protected function postDataTableLoadedFromAPI()
{
if (empty($this->dataTable)) {
return false;
}
// deal w/ table metadata
if ($this->dataTable instanceof Piwik_DataTable) {
$this->viewProperties['metadata'] = $this->dataTable->getAllTableMetadata();
if (isset($this->viewProperties['metadata'][Piwik_DataTable::ARCHIVED_DATE_METADATA_NAME])) {
$this->viewProperties['metadata'][Piwik_DataTable::ARCHIVED_DATE_METADATA_NAME] = $this->makePrettyArchivedOnText();
}
}
// First, filters that delete rows
foreach ($this->queuedFiltersPriority as $filter) {
$filterName = $filter[0];
$filterParameters = $filter[1];
$this->dataTable->filter($filterName, $filterParameters);
}
if (!$this->areGenericFiltersDisabled()) {
// Second, generic filters (Sort, Limit, Replace Column Names, etc.)
$requestString = $this->getRequestString();
$request = Piwik_API_Request::getRequestArrayFromString($requestString);
if (!empty($this->variablesDefault['enable_sort']) && $this->variablesDefault['enable_sort'] === 'false') {
$request['filter_sort_column'] = $request['filter_sort_order'] = '';
}
$genericFilter = new Piwik_API_DataTableGenericFilter($request);
$genericFilter->filter($this->dataTable);
}
if (!$this->areQueuedFiltersDisabled()) {
// Finally, apply datatable filters that were queued (should be 'presentation' filters that
// do not affect the number of rows)
foreach ($this->queuedFilters as $filter) {
$filterName = $filter[0];
$filterParameters = $filter[1];
$this->dataTable->filter($filterName, $filterParameters);
}
}
return true;
}