original_string: public static function createDataTableFromArchive($recordName, $idSite, $period, $date, $segment, $expanded = false, $flat = false, $idSubtable = null, $depth = null)
      {
          Piwik::checkUserHasViewAccess($idSite);
  
          if ($flat && !$idSubtable) {
              $expanded = true;
          }
  
          $archive = Archive::build($idSite, $period, $date, $segment, $_restrictSitesToLogin = false);
          if ($idSubtable === false) {
              $idSubtable = null;
          }
  
          if ($expanded) {
              $dataTable = $archive->getDataTableExpanded($recordName, $idSubtable, $depth);
          } else {
              $dataTable = $archive->getDataTable($recordName, $idSubtable);
          }
  
          $dataTable->queueFilter('ReplaceSummaryRowLabel');
          $dataTable->queueFilter('ReplaceColumnNames');
  
          if ($expanded) {
              $dataTable->queueFilterSubtables('ReplaceColumnNames');
          }
  
          if ($flat) {
              $dataTable->disableRecursiveFilters();
          }
  
          return $dataTable;
      }
code: public static function createDataTableFromArchive($recordName, $idSite, $period, $date, $segment, $expanded = false, $flat = false, $idSubtable = null, $depth = null)
      {
          Piwik::checkUserHasViewAccess($idSite);
  
          if ($flat && !$idSubtable) {
              $expanded = true;
          }
  
          $archive = Archive::build($idSite, $period, $date, $segment, $_restrictSitesToLogin = false);
          if ($idSubtable === false) {
              $idSubtable = null;
          }
  
          if ($expanded) {
              $dataTable = $archive->getDataTableExpanded($recordName, $idSubtable, $depth);
          } else {
              $dataTable = $archive->getDataTable($recordName, $idSubtable);
          }
  
          $dataTable->queueFilter('ReplaceSummaryRowLabel');
          $dataTable->queueFilter('ReplaceColumnNames');
  
          if ($expanded) {
              $dataTable->queueFilterSubtables('ReplaceColumnNames');
          }
  
          if ($flat) {
              $dataTable->disableRecursiveFilters();
          }
  
          return $dataTable;
      }
code_tokens: public static function createDataTableFromArchive ( $ recordName , $ idSite , $ period , $ date , $ segment , $ expanded = false , $ flat = false , $ idSubtable = null , $ depth = null ) { Piwik :: checkUserHasViewAccess ( $ idSite ) ; if ( $ flat && ! $ idSubtable ) { $ expanded = true ; } $ archive = Archive :: build ( $ idSite , $ period , $ date , $ segment , $ _restrictSitesToLogin = false ) ; if ( $ idSubtable === false ) { $ idSubtable = null ; } if ( $ expanded ) { $ dataTable = $ archive -> getDataTableExpanded ( $ recordName , $ idSubtable , $ depth ) ; } else { $ dataTable = $ archive -> getDataTable ( $ recordName , $ idSubtable ) ; } $ dataTable -> queueFilter ( 'ReplaceSummaryRowLabel' ) ; $ dataTable -> queueFilter ( 'ReplaceColumnNames' ) ; if ( $ expanded ) { $ dataTable -> queueFilterSubtables ( 'ReplaceColumnNames' ) ; } if ( $ flat ) { $ dataTable -> disableRecursiveFilters ( ) ; } return $ dataTable ; }
docstring: Helper function that creates an Archive instance and queries for report data using
  query parameter data. API methods can use this method to reduce code redundancy.
  
  @param string $recordName The name of the report to return.
  @param int|string|array $idSite @see {@link build()}
  @param string $period @see {@link build()}
  @param string $date @see {@link build()}
  @param string $segment @see {@link build()}
  @param bool $expanded If true, loads all subtables. See {@link getDataTableExpanded()}
  @param bool $flat If true, loads all subtables and disabled all recursive filters.
  @param int|null $idSubtable See {@link getDataTableExpanded()}
  @param int|null $depth See {@link getDataTableExpanded()}
  @return DataTable|DataTable\Map
docstring_tokens: Helper function that creates an Archive instance and queries for report data using query parameter data . API methods can use this method to reduce code redundancy .