🎨 Fix parameter for all DBSearch::AllowAllData impl

This commit is contained in:
Pierre Goiffon
2020-10-01 09:45:00 +02:00
parent e9f81bd978
commit 6cd0670d6b
2 changed files with 30 additions and 35 deletions

View File

@@ -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;

View File

@@ -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;