Piwik\Plugins\Referrers\API::removeSubtableIds PHP 메소드

removeSubtableIds() 개인적인 메소드

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
리턴 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;
    }