From 1ad956d65c6eb49c3d6b192d0adac9ce33aa0989 Mon Sep 17 00:00:00 2001 From: diosmosis <benaka@piwik.pro> Date: Fri, 19 Sep 2014 10:03:27 -0700 Subject: [PATCH] Add public Report::isSubtableReport() method so it can be used in closure on PHP 5.3. --- core/Plugin/Report.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php index a907b0f709..6d950babd2 100644 --- a/core/Plugin/Report.php +++ b/core/Plugin/Report.php @@ -601,6 +601,16 @@ class Report return $subtableReport->getDimension(); } + /** + * Returns true if the report is for another report's subtable, false if otherwise. + * + * @return bool + */ + public function isSubtableReport() + { + return $this->isSubtableReport; + } + /** * Fetches the report represented by this instance. * @@ -722,7 +732,7 @@ class Report public static function getForDimension(Dimension $dimension) { return ComponentFactory::getComponentIf(__CLASS__, $dimension->getModule(), function (Report $report) use ($dimension) { - return !$report->isSubtableReport + return !$report->isSubtableReport() && $report->getDimension() && $report->getDimension()->getId() == $dimension->getId(); }); -- GitLab