findSettingDetailInArray($name, $adminSettingDefinition->getSettingDetails()); if(!$settingDetail) { $this->findSettingDetailInArray($name, $producerSettingDefinition->getSettingDetails()); } if(!$settingDetail) { throw new \Exception('SettingDetail non trouvé'); } return $settingDetail; } public function findSettingDetailInArray(string $name, array $settingDetailsArray) { foreach($settingDetailsArray as $section => $subsectionsArray) { foreach($subsectionsArray as $subsection => $settingDetailsArray) { foreach($settingDetailsArray as $settingDetail) { if($name == $settingDetail->getName()) { return $settingDetail; } } } } return null; } }