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:
Diffstat (limited to 'plugins/SegmentEditor/SegmentList.php')
-rw-r--r--plugins/SegmentEditor/SegmentList.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/SegmentEditor/SegmentList.php b/plugins/SegmentEditor/SegmentList.php
new file mode 100644
index 0000000000..e7094d4793
--- /dev/null
+++ b/plugins/SegmentEditor/SegmentList.php
@@ -0,0 +1,32 @@
+<?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\Plugins\SegmentEditor;
+
+use Piwik\API\Request;
+use Piwik\Config;
+use Piwik\Db;
+
+/**
+ */
+class SegmentList
+{
+ public function findSegment($segmentName, $idSite)
+ {
+ $segments = Request::processRequest('API.getSegmentsMetadata', array(
+ 'idSites' => array($idSite),
+ ));
+
+ foreach ($segments as $segment) {
+ if ($segment['segment'] == $segmentName && !empty($segmentName)) {
+ return $segment;
+ }
+ }
+ }
+
+}