From 6cd0670d6b70e33f8da20cb293c93f10479bf809 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Thu, 1 Oct 2020 09:45:00 +0200 Subject: [PATCH] :art: Fix parameter for all DBSearch::AllowAllData impl --- core/dbsearch.class.php | 52 +++++++++++++++++------------------- core/dbunionsearch.class.php | 13 ++++----- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/core/dbsearch.class.php b/core/dbsearch.class.php index e5ce11999..e59493d80 100644 --- a/core/dbsearch.class.php +++ b/core/dbsearch.class.php @@ -97,42 +97,40 @@ abstract class DBSearch /** * Perform a deep clone (as opposed to "clone" which does copy a reference to the underlying objects) * - * @internal - * + * @internal + * * @return \DBSearch - **/ + **/ public function DeepClone() { return unserialize(serialize($this)); // Beware this serializes/unserializes the search and its parameters as well } - /** - * whether or not some information should be hidden to the current user. - * - * @api - * @see IsAllDataAllowed() - * - * @return mixed - */ - abstract public function AllowAllData(); + /** + * @api + * @see IsAllDataAllowed() + * + * @param bool $bAllowAllData whether or not some information should be hidden to the current user. + */ + abstract public function AllowAllData($bAllowAllData = true); - /** - * Current state of AllowAllData - * - * @internal - * @see AllowAllData() - * - * @return mixed - */ + /** + * Current state of AllowAllData + * + * @internal + * @see AllowAllData() + * + * @return mixed + */ abstract public function IsAllDataAllowed(); - /** - * Should the archives be fetched - * - * @internal - * - * @param $bEnable - */ + /** + * Should the archives be fetched + * + * @internal + * + * @param $bEnable + */ public function SetArchiveMode($bEnable) { $this->m_bArchiveMode = $bEnable; diff --git a/core/dbunionsearch.class.php b/core/dbunionsearch.class.php index 721191bd3..a574af4b7 100644 --- a/core/dbunionsearch.class.php +++ b/core/dbunionsearch.class.php @@ -65,9 +65,7 @@ class DBUnionSearch extends DBSearch { $this->aSearches[] = $oSubSearch->DeepClone(); } - } - else - { + } else { $this->aSearches[] = $oSearch->DeepClone(); } } @@ -75,17 +73,16 @@ class DBUnionSearch extends DBSearch $this->ComputeSelectedClasses(); } - public function AllowAllData() + public function AllowAllData($bAllowAllData = true) { - foreach ($this->aSearches as $oSearch) - { + foreach ($this->aSearches as $oSearch) { $oSearch->AllowAllData(); } } + public function IsAllDataAllowed() { - foreach ($this->aSearches as $oSearch) - { + foreach ($this->aSearches as $oSearch) { if ($oSearch->IsAllDataAllowed() === false) return false; } return true;