diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2017-09-26 04:32:54 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-09-26 04:32:54 +0300 |
commit | 948e1f04b48b7f6a8ef7d0f0421bf075feb9003a (patch) | |
tree | f21ba915daca8ce86eb2cb57fe7bec76688bfb19 /core/Plugin/Report.php | |
parent | 2459f222b6f96db3698e1f6b380c59a0bd8b5938 (diff) |
Better fetching of saved report parameters by report ID (#11983)
* Better report parameter fetching
* prefer a unique report id
* add method to get id
* removed code that is supposed to be in different PR
Diffstat (limited to 'core/Plugin/Report.php')
-rw-r--r-- | core/Plugin/Report.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php index df28f450c9..24887fb4c0 100644 --- a/core/Plugin/Report.php +++ b/core/Plugin/Report.php @@ -318,6 +318,26 @@ class Report } /** + * + * Processing a uniqueId for each report, can be used by UIs as a key to match a given report + * @return string + */ + public function getId() + { + $params = $this->getParameters(); + + $paramsKey = $this->getModule() . '.' . $this->getAction(); + + if (!empty($params)) { + foreach ($params as $key => $value) { + $paramsKey .= '_' . $key . '--' . $value; + } + } + + return $paramsKey; + } + + /** * lets you add any amount of widgets for this report. If a report defines a {@link $categoryId} and a * {@link $subcategoryId} a widget will be generated automatically. * |