summaryrefslogtreecommitdiffstats
path: root/library/Cube/Dimension.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:16:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:16:36 +0000
commitd61b7618d9c04ff90fdf8d3b584ad5976faedad9 (patch)
tree6de6eaca7793f0f1f756c9a5a0fa9e07957c8569 /library/Cube/Dimension.php
parentInitial commit. (diff)
downloadicingaweb2-module-cube-upstream/1.3.2.tar.xz
icingaweb2-module-cube-upstream/1.3.2.zip
Adding upstream version 1.3.2.upstream/1.3.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/Cube/Dimension.php')
-rw-r--r--library/Cube/Dimension.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/library/Cube/Dimension.php b/library/Cube/Dimension.php
new file mode 100644
index 0000000..071e934
--- /dev/null
+++ b/library/Cube/Dimension.php
@@ -0,0 +1,70 @@
+<?php
+
+// Icinga Web 2 Cube Module | (c) 2016 Icinga GmbH | GPLv2
+
+namespace Icinga\Module\Cube;
+
+/**
+ * Dimension interface
+ *
+ * All available dimensions must implement this interface
+ *
+ * @package Icinga\Module\Cube
+ */
+interface Dimension
+{
+ /**
+ * The name of this dimension
+ *
+ * @return string
+ */
+ public function getName();
+
+ /**
+ * Fetch label of this dimension
+ *
+ * @return string
+ */
+ public function getLabel();
+
+ /**
+ * Add a label
+ *
+ * @param string $label
+ *
+ * @return $this
+ */
+ public function addLabel(string $label);
+
+ /**
+ * Set the label for the dimension
+ *
+ * @param string $label
+ *
+ * @return $this
+ */
+ public function setLabel(string $label);
+
+ /**
+ * Column expression
+ *
+ * This is the expression used to fetch the related column. Usually an SQL
+ * snippet when a relational database is involved
+ *
+ * @param Cube $cube
+ *
+ * @return string
+ */
+ public function getColumnExpression(Cube $cube);
+
+ /**
+ * Add this dimension to a cube
+ *
+ * This allows your dimension to apply itself to the Cube. That way your
+ * dimension is able to join optional tables and more
+ *
+ * @param Cube $cube
+ * @return void
+ */
+ public function addToCube(Cube $cube);
+}