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
path: root/core
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2022-02-01 12:49:08 +0300
committerGitHub <noreply@github.com>2022-02-01 12:49:08 +0300
commitaa66aca8e0e98267515fe1204f2d47dbb1785e67 (patch)
treeb3293cb03cec5246049b53ff6e60c2c4b2ef7f44 /core
parent4b59d5f56af5eb40e04bed7fdeb795f14d09554c (diff)
Add new event Segment.filterSegments (#18713)
* Add new event Segment.filterSegments For many other `*.add*` events we also have matching `.filter*` events. However, it doesn't seem to be the case for segments. Eg we have this for `Access.Capability.filterCapabilities`, `Dimension.filterDimensions`, `Metric.filterMetrics`, `Report.filterReports`. * Update CHANGELOG.md
Diffstat (limited to 'core')
-rw-r--r--core/Segment/SegmentsList.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/Segment/SegmentsList.php b/core/Segment/SegmentsList.php
index 82ea86065e..448a4f1593 100644
--- a/core/Segment/SegmentsList.php
+++ b/core/Segment/SegmentsList.php
@@ -132,6 +132,20 @@ class SegmentsList
$dimension->configureSegments($list, new DimensionSegmentFactory($dimension));
}
+ /**
+ * Triggered to filter segment definitions.
+ *
+ * **Example**
+ *
+ * public function filterSegments(&$segmentList)
+ * {
+ * $segmentList->remove('Category');
+ * }
+ *
+ * @param SegmentsList $list An instance of the SegmentsList.
+ */
+ Piwik::postEvent('Segment.filterSegments', array($list));
+
$cache->save($cacheKey, $list);
return $list;