Piwik\DataTable::getEmptyClone PHP 메소드

getEmptyClone() 공개 메소드

Returns an empty DataTable with the same metadata and queued filters as $this one.
public getEmptyClone ( boolean $keepFilters = true ) : DataTable
$keepFilters boolean Whether to pass the queued filter list to the new DataTable or not.
리턴 DataTable
    public function getEmptyClone($keepFilters = true)
    {
        $clone = new DataTable();
        if ($keepFilters) {
            $clone->queuedFilters = $this->queuedFilters;
        }
        $clone->metadata = $this->metadata;
        return $clone;
    }

Usage Example

예제 #1
0
파일: Flattener.php 프로젝트: piwik/piwik
 /**
  * Template method called from self::manipulate.
  * Flatten each data table.
  *
  * @param DataTable $dataTable
  * @return DataTable
  */
 protected function manipulateDataTable($dataTable)
 {
     $newDataTable = $dataTable->getEmptyClone($keepFilters = true);
     // this recursive filter will be applied to subtables
     $dataTable->filter('ReplaceSummaryRowLabel');
     $this->flattenDataTableInto($dataTable, $newDataTable);
     return $newDataTable;
 }
All Usage Examples Of Piwik\DataTable::getEmptyClone