Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2014-09-18 07:40:38 +0400
committerdiosmosis <benaka@piwik.pro>2014-09-18 07:40:38 +0400
commit41fabcb3488f00f5840dc2c231519488322b1837 (patch)
tree32021d167f45a4047e0195841fbb4fba8eed167f /core/Columns
parentaafb07c75b86b7905da1d7525e2800c8dbad2cde (diff)
Adding new PivotByDimension DataTable filter that can pivot a report by (almost) any dimension. The filter can pivot reports by their subtable dimension and can also pivot by other dimensions (by using segments).
Notes: - in the UI, only pivoting by subtable is supported - change to CSV DataTable renderer so column names w/ commas & quotes can appear in text - change to XML DataTable renderer so column names w/ invalid XML characters can be rendered (bit of an iffy change, XML format needs an overhaul I think) - includes new config option 'pivot_by_filter_enable_fetch_by_segment' - includes additions to component metadata classes (ie, Report/Dimension)
Diffstat (limited to 'core/Columns')
-rw-r--r--core/Columns/Dimension.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/core/Columns/Dimension.php b/core/Columns/Dimension.php
index c2b39093e4..a6f8831a71 100644
--- a/core/Columns/Dimension.php
+++ b/core/Columns/Dimension.php
@@ -195,10 +195,29 @@ abstract class Dimension
* @return Dimension|null The created instance or null if there is no Dimension for
* $dimensionId or if the plugin that contains the Dimension is
* not loaded.
+ * @api
*/
public static function factory($dimensionId)
{
list($module, $dimension) = explode('.', $dimensionId);
return ComponentFactory::factory($module, $dimension, __CLASS__);
}
-}
+
+ /**
+ * Returns the name of the plugin that contains this Dimension.
+ *
+ * @return string
+ * @throws Exception if the Dimension is not located within a Plugin module.
+ * @api
+ */
+ public function getModule()
+ {
+ $id = $this->getId();
+ if (empty($id)) {
+ throw new Exception("Invalid dimension ID: '$id'.");
+ }
+
+ $parts = explode('.', $id);
+ return reset($parts);
+ }
+} \ No newline at end of file