public getEmptyClone ( boolean $keepFilters = true ) : |
||
$keepFilters | boolean | Whether to pass the queued filter list to the new DataTable or not. |
return |
public function getEmptyClone($keepFilters = true)
{
$clone = new DataTable();
if ($keepFilters) {
$clone->queuedFilters = $this->queuedFilters;
}
$clone->metadata = $this->metadata;
return $clone;
}
/** * 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; }