Piwik\Plugins\Referrers\API::removeSubtableIds PHP Méthode

removeSubtableIds() private méthode

Utility function that removes the subtable IDs for the subtables of the getReferrerType report. This avoids infinite recursion in said report (ie, the grandchildren of the report will be the original report, and it will recurse when trying to get a flat report).
private removeSubtableIds ( DataTable $table ) : DataTable
$table Piwik\DataTable
Résultat Piwik\DataTable Returns $table for convenience.
    private function removeSubtableIds($table)
    {
        if ($table instanceof DataTable\Map) {
            foreach ($table->getDataTables() as $childTable) {
                $this->removeSubtableIds($childTable);
            }
        } else {
            foreach ($table->getRows() as $row) {
                $row->removeSubtable();
            }
        }
        return $table;
    }