getForDimension() public static method

Finds a top level report that provides stats for a specific Dimension.
public static getForDimension ( Dimension $dimension ) : Report | null
$dimension Piwik\Columns\Dimension The dimension whose report we're looking for.
return Report | null The
Ejemplo n.º 1
0
 private function setPivotByDimension($pivotByDimension)
 {
     $this->pivotByDimension = Dimension::factory($pivotByDimension);
     if (empty($this->pivotByDimension)) {
         throw new Exception("Invalid dimension '{$pivotByDimension}'.");
     }
     $this->pivotDimensionReport = Report::getForDimension($this->pivotByDimension);
 }
Ejemplo n.º 2
0
 public function test_getForDimension_ShouldReturnNullIfReportPluginNotLoaded()
 {
     PluginManager::getInstance()->loadPlugins(array());
     $report = Report::getForDimension(new Keyword());
     $this->assertNull($report);
 }