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:
authorThomas Steur <thomas.steur@gmail.com>2015-11-17 07:03:04 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-11-19 07:14:31 +0300
commit433c5c93a8524bd5d4dec7c6f73bc8dca957cb66 (patch)
treef95d8f47d6f716e0199f3c9222f472daa14dae17 /core/Plugin/Segment.php
parent1de540f1003eb303f73098ae690a8ef366977d2f (diff)
refs #8076 #9224 adding new segment ActionUrl + new operators starts with and ends with
Diffstat (limited to 'core/Plugin/Segment.php')
-rw-r--r--core/Plugin/Segment.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/Plugin/Segment.php b/core/Plugin/Segment.php
index 8a9688fb0b..3d6914fe5c 100644
--- a/core/Plugin/Segment.php
+++ b/core/Plugin/Segment.php
@@ -51,6 +51,7 @@ class Segment
private $acceptValues;
private $permission;
private $suggestedValuesCallback;
+ private $unionOfSegments;
/**
* If true, this segment will only be visible to the user if the user has view access
@@ -168,6 +169,27 @@ class Segment
}
/**
+ * Set a list of segments that should be used instead of fetching the values from a single column.
+ * All set segments will be applied via an OR operator.
+ *
+ * @param array $segments
+ * @api
+ */
+ public function setUnionOfSegments($segments)
+ {
+ $this->unionOfSegments = $segments;
+ }
+
+ /**
+ * @return array
+ * @ignore
+ */
+ public function getUnionOfSegments()
+ {
+ return $this->unionOfSegments;
+ }
+
+ /**
* @return string
* @ignore
*/
@@ -196,6 +218,15 @@ class Segment
}
/**
+ * @return string
+ * @ignore
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
* Returns the name of this segment as it should appear in segment expressions.
*
* @return string
@@ -241,6 +272,10 @@ class Segment
'sqlSegment' => $this->sqlSegment,
);
+ if (!empty($this->unionOfSegments)) {
+ $segment['unionOfSegments'] = $this->unionOfSegments;
+ }
+
if (!empty($this->sqlFilter)) {
$segment['sqlFilter'] = $this->sqlFilter;
}