本文整理汇总了PHP中Piwik\Archive::createDataTableFromArchive方法的典型用法代码示例。如果您正苦于以下问题:PHP Archive::createDataTableFromArchive方法的具体用法?PHP Archive::createDataTableFromArchive怎么用?PHP Archive::createDataTableFromArchive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Archive
的用法示例。
在下文中一共展示了Archive::createDataTableFromArchive方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDataTable
/**
* @param int $idSite
* @param string $period
* @param Date $date
* @param string $segment
* @param bool $expanded
* @param int $idSubtable
*
* @return DataTable|DataTable\Map
*/
protected function getDataTable($idSite, $period, $date, $segment, $expanded, $flat, $idSubtable)
{
$dataTable = Archive::createDataTableFromArchive(Archiver::CUSTOM_VARIABLE_RECORD_NAME, $idSite, $period, $date, $segment, $expanded, $flat, $idSubtable);
$dataTable->queueFilter('ColumnDelete', 'nb_uniq_visitors');
if ($flat) {
$dataTable->filterSubtables('Sort', array(Metrics::INDEX_NB_ACTIONS, 'desc', $naturalSort = false, $expanded));
$dataTable->queueFilterSubtables('ColumnDelete', 'nb_uniq_visitors');
}
return $dataTable;
}
示例2: getDataTable
private function getDataTable($name, $idSite, $period, $date, $segment, $expanded, $idSubtable)
{
Piwik::checkUserHasViewAccess($idSite);
$recordName = Dimensions::getRecordNameForAction($name);
$dataTable = Archive::createDataTableFromArchive($recordName, $idSite, $period, $date, $segment, $expanded, $flat = false, $idSubtable);
if (empty($idSubtable)) {
$dataTable->filter('AddSegmentValue', array(function ($label) {
if ($label === Archiver::CONTENT_PIECE_NOT_SET) {
return false;
}
return $label;
}));
}
$this->filterDataTable($dataTable);
return $dataTable;
}
示例3: getCustomDimension
/**
* Fetch a report for the given idDimension. Only reports for active dimensions can be fetched. Requires at least
* view access.
*
* @param int $idDimension
* @param int $idSite
* @param string $period
* @param string $date
* @param bool|false $segment
* @param bool|false $expanded
* @param bool|false $flat
* @param int|null $idSubtable
* @return DataTable|DataTable\Map
* @throws \Exception
*/
public function getCustomDimension($idDimension, $idSite, $period, $date, $segment = false, $expanded = false, $flat = false, $idSubtable = null)
{
Piwik::checkUserHasViewAccess($idSite);
$dimension = new Dimension($idDimension, $idSite);
$dimension->checkActive();
$record = Archiver::buildRecordNameForCustomDimensionId($idDimension);
$dataTable = Archive::createDataTableFromArchive($record, $idSite, $period, $date, $segment, $expanded, $flat, $idSubtable);
if (isset($idSubtable) && $dataTable->getRowsCount()) {
$parentTable = Archive::createDataTableFromArchive($record, $idSite, $period, $date, $segment);
foreach ($parentTable->getRows() as $row) {
if ($row->getIdSubDataTable() == $idSubtable) {
$parentValue = $row->getColumn('label');
$dataTable->queueFilter('Piwik\\Plugins\\CustomDimensions\\DataTable\\Filter\\AddSubtableSegmentMetadata', array($idDimension, $parentValue));
break;
}
}
} else {
$dataTable->queueFilter('Piwik\\Plugins\\CustomDimensions\\DataTable\\Filter\\AddSegmentMetadata', array($idDimension));
}
$dataTable->filter('Piwik\\Plugins\\CustomDimensions\\DataTable\\Filter\\RemoveUserIfNeeded', array($idSite, $period, $date));
return $dataTable;
}
示例4: buildExpandedTableForFlattenGetSocials
/**
* @param int $idSite
* @param string $period
* @param string $date
* @param string|false $segment
* @param bool $expanded
* @param DataTable $dataTable
*/
private function buildExpandedTableForFlattenGetSocials($idSite, $period, $date, $segment, $expanded, $dataTable)
{
$urlsTable = Archive::createDataTableFromArchive(Archiver::WEBSITES_RECORD_NAME, $idSite, $period, $date, $segment, $expanded, $flat = true);
$urlsTable->filter('ColumnCallbackDeleteRow', array('label', function ($url) {
return !Social::getInstance()->isSocialUrl($url);
}));
$urlsTable = $urlsTable->mergeSubtables();
foreach ($dataTable->getRows() as $row) {
$row->removeSubtable();
$social = $row->getColumn('label');
$newTable = $urlsTable->getEmptyClone();
$rows = $urlsTable->getRows();
foreach ($rows as $id => $urlsTableRow) {
$url = $urlsTableRow->getColumn('label');
if (Social::getInstance()->isSocialUrl($url, $social)) {
$newTable->addRow($urlsTableRow);
$urlsTable->deleteRow($id);
}
}
if ($newTable->getRowsCount()) {
$newTable->filter('Piwik\\Plugins\\Referrers\\DataTable\\Filter\\UrlsForSocial', array($expanded));
$row->setSubtable($newTable);
}
}
Common::destroy($urlsTable);
$urlsTable = null;
}
示例5: getDataTable
protected function getDataTable($name, $idSite, $period, $date, $segment, $expanded = false, $idSubtable = null, $secondaryDimension = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$this->checkSecondaryDimension($name, $secondaryDimension);
$recordName = $this->getRecordNameForAction($name, $secondaryDimension);
$dataTable = Archive::createDataTableFromArchive($recordName, $idSite, $period, $date, $segment, $expanded, $flat, $idSubtable);
if ($flat) {
$dataTable->filterSubtables('Piwik\\Plugins\\Events\\DataTable\\Filter\\ReplaceEventNameNotSet');
} else {
$dataTable->filter('AddSegmentValue', array(function ($label) {
if ($label === Archiver::EVENT_NAME_NOT_SET) {
return false;
}
return $label;
}));
}
$dataTable->filter('Piwik\\Plugins\\Events\\DataTable\\Filter\\ReplaceEventNameNotSet');
return $dataTable;
}
示例6: getDataTable
/**
* Function for returning a data table based on the passed selection
* Used to generate the reports for all utm parameters
* @param string $name
* @param int $idSite
* @param string $period
* @param string|Date $date
* @param string $segment
* @param boolean $expanded
* @param int|null $idSubtable
* @return DataTable
*/
private function getDataTable($name, $idSite, $period, $date, $segment, $expanded = false, $idSubtable = null)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = Archive::createDataTableFromArchive($name, $idSite, $period, $date, $segment, $expanded, $idSubtable);
return $dataTable;
}
示例7: getSiteSearchKeywordsRaw
protected function getSiteSearchKeywordsRaw($idSite, $period, $date, $segment)
{
$dataTable = Archive::createDataTableFromArchive('Actions_sitesearch', $idSite, $period, $date, $segment, $expanded = false);
return $dataTable;
}