本文整理匯總了PHP中Piwik_DataTable::getAllTableMetadata方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik_DataTable::getAllTableMetadata方法的具體用法?PHP Piwik_DataTable::getAllTableMetadata怎麽用?PHP Piwik_DataTable::getAllTableMetadata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik_DataTable
的用法示例。
在下文中一共展示了Piwik_DataTable::getAllTableMetadata方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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
*
* @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;
}