Piwik\Plugin\Report::getSubtableDimension PHP Method

getSubtableDimension() public method

Returns the Dimension instance of this report's subtable report.
public getSubtableDimension ( ) : Dimension | null
return Piwik\Columns\Dimension | null The subtable report's dimension or null if there is subtable report or no dimension for the subtable report.
    public function getSubtableDimension()
    {
        if (empty($this->actionToLoadSubTables)) {
            return null;
        }
        list($subtableReportModule, $subtableReportAction) = $this->getSubtableApiMethod();
        $subtableReport = ReportsProvider::factory($subtableReportModule, $subtableReportAction);
        if (empty($subtableReport)) {
            return null;
        }
        return $subtableReport->getDimension();
    }

Usage Example

コード例 #1
0
ファイル: PivotByDimension.php プロジェクト: bossrabbit/piwik
 /**
  * Returns true if pivoting by subtable is supported for a report. Will return true if the report
  * has a subtable dimension and if the subtable dimension is different than the report's dimension.
  *
  * @param Report $report
  * @return bool
  */
 public static function isPivotingReportBySubtableSupported(Report $report)
 {
     return self::areDimensionsNotEqualAndNotNull($report->getSubtableDimension(), $report->getDimension());
 }