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-11-02 11:14:21 +0300
committerdiosmosis <benaka@piwik.pro>2014-11-07 04:46:07 +0300
commitb082b508a9232a1c9f6e55831fbb67d2643e6efa (patch)
tree27e550bacb8996fdbde084537ec5904e3c2f7a24 /core/Plugin/Metric.php
parentabeb75a282ada95f6088cf7aa2a98a3f084a365d (diff)
[poc] moved BounceRate calculation to ProcessedMetric class.
Diffstat (limited to 'core/Plugin/Metric.php')
-rw-r--r--core/Plugin/Metric.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/core/Plugin/Metric.php b/core/Plugin/Metric.php
new file mode 100644
index 0000000000..09c8d2298e
--- /dev/null
+++ b/core/Plugin/Metric.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugin;
+
+use Piwik\DataTable\Row;
+
+/**
+ * TODO
+ *
+ * TODO: note that this will be filled out in another issue
+ */
+abstract class Metric
+{
+ /**
+ * The sub-namespace name in a plugin where Report components are stored.
+ */
+ const COMPONENT_SUBNAMESPACE = 'Metrics';
+
+ /**
+ * TODO
+ *
+ * @return Metric[]
+ */
+ public static function getAll()
+ {
+ $components = Manager::getInstance()->findMultipleComponents(self::COMPONENT_SUBNAMESPACE, __CLASS__);
+
+ $result = array();
+ foreach ($components as $componentClass) {
+ /** @var Metric $component */
+ $component = new $componentClass();
+
+ $name = $component->getName();
+ $result[$name] = $component;
+ }
+ return $result;
+ }
+
+ /**
+ * TODO
+ */
+ abstract public function getName();
+} \ No newline at end of file