Piwik\Archive::getDataTableExpanded PHP Method

getDataTableExpanded() public method

If multiple sites were requested in {@link build()} or {@link factory()} the result will be a DataTable\Map that is indexed by site ID. If multiple periods were requested in {@link build()} or {@link factory()} the result will be a DataTable\Map that is indexed by period. The site ID index is always first, so if multiple sites & periods were requested, the result will be a {@link DataTable\Map indexed} by site ID which contains {@link DataTable\Map} instances that are indexed by period.
public getDataTableExpanded ( string $name, integer | string | null $idSubtable = null, integer | null $depth = null, boolean $addMetadataSubtableId = true ) : DataTable | Piwik\DataTable\Map
$name string The name of the record to get.
$idSubtable integer | string | null The ID of the subtable to get (if any). The subtable will be expanded.
$depth integer | null The maximum number of subtable levels to load. If null, all levels are loaded. For example, if `1` is supplied, then the DataTable returned will have its subtables loaded. Those subtables, however, will NOT have their subtables loaded.
$addMetadataSubtableId boolean Whether to add the database subtable ID as metadata to each datatable, or not.
return DataTable | Piwik\DataTable\Map
    public function getDataTableExpanded($name, $idSubtable = null, $depth = null, $addMetadataSubtableId = true)
    {
        $data = $this->get($name, 'blob', self::ID_SUBTABLE_LOAD_ALL_SUBTABLES);
        return $data->getExpandedDataTable($this->getResultIndices(), $idSubtable, $depth, $addMetadataSubtableId);
    }