[Removed] over-engineered Getter-methods

- the methods would semi-automatic search and set/ save params
- I removed those and set it back to its base functionality:
-- saving happens ONLY at the save() function if triggered by the user in the admin-frontend
-- only one Getter who checks for a value in the DB ? give the value : no value given yet
Cette révision appartient à :
2025-03-19 08:39:10 +01:00
Parent e347739bd3
révision b2a302fbb3
3 fichiers modifiés avec 4 ajouts et 51 suppressions

Voir le fichier

@ -7,32 +7,6 @@ use OxidEsales\Eshop\Core\ViewConfig;
class ManagerHandler
{
/**
* Gets current chosen Manager
*
* @return string
*/
public function getCurrManager() :string
{
if ($this->getModuleSettingExplicitManagerSelectValue()){
return $this->getExplicitManager();
}
/** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class);
/** @var ViewConfig $oViewConfig */
$oViewConfig = oxNew(ViewConfig::class);
$aManagerList = $oManagerTypes->getManagerList();
foreach ($aManagerList as $shopModuleId => $publicCMPName){
if ($oViewConfig->isModuleActive($shopModuleId)){
return $shopModuleId;
}
}
return "";
}
/**
* @param string $sParam
* @return void
@ -50,24 +24,8 @@ class ManagerHandler
/**
* @return string
*/
public function getModuleSettingExplicitManagerSelectValue() :string
public function getActManager() :string
{
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:"";
}
/**
* @return string
*/
public function getExplicitManager() :string
{
$sPotentialManagerName = $this->getModuleSettingExplicitManagerSelectValue();
/** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class);
$sCMPName = $oManagerTypes->isManagerInList($sPotentialManagerName)
? $sPotentialManagerName
: "NONE";
return $sCMPName;
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:"";
}
}