getSettings()) { foreach ($entity->getSettings() as $setting) { if ($setting->getName() == $name) { return $setting; } } } return null; } public function getSettingValue(EntityInterface $entity, string $name) { $setting = $this->getSetting($entity, $name); if($setting) { return $this->getValue($setting); } return null; } public function getValue(SettingInterface $setting) { if ($setting->getText()) { return $setting->getText(); } elseif ($setting->getDate()) { return $setting->getDate(); } elseif ($setting->getFile()) { return $setting->getFile(); } return null; } public function getDefaultValue(EntityInterface $entity, $settingDefault) { $valueDefault = null; if(is_array($settingDefault)) { if(isset($settingDefault[$entity->getDevAlias()])) { $valueDefault = $settingDefault[$entity->getDevAlias()]; } } else { $valueDefault = $settingDefault; } return $valueDefault; } }