[ self::SUBSECTION_GENERAL => [ new SupportOnlineAdminSetting(), new AdministratorEmailAdminSetting(), new AdministratorPhoneNumberAdminSetting(), new MaximumNumberProducersAdminSetting(), new ForumFlarumUrlAdminSetting(), new MailerAdminSetting(), new BulkMailerAdminSetting(), ] ], self::SECTION_ALERT_MESSAGE => [ self::SUBSECTION_ALERT_MESSAGE_GLOBAL => [ new AdminAlertMessageDisplaySetting(), new AdminAlertMessageTypeSetting(), new AdminAlertMessageIconSetting(), new AdminAlertMessageTitleSetting(), new AdminAlertMessageSetting(), new AdminAlertMessageUpdatedAtSetting(), ], self::SUBSECTION_ALERT_MESSAGE_SUPPORT => [ new AdminSupportAlertMessageDisplaySetting(), new AdminSupportAlertMessageTypeSetting(), new AdminSupportAlertMessageIconSetting(), new AdminSupportAlertMessageTitleSetting(), new AdminSupportAlertMessageSetting(), ], ] ]; } public function getSectionLabels(): array { return [ self::SECTION_GENERAL => 'General', self::SUBSECTION_GENERAL => 'General', self::SECTION_ALERT_MESSAGE => 'Message d\'alerte', self::SUBSECTION_ALERT_MESSAGE_GLOBAL => 'Global', self::SUBSECTION_ALERT_MESSAGE_SUPPORT => 'Support' ]; } public function getSectionsArray(): array { $sectionsArray = []; foreach($this->getSettingDetails() as $sectionName => $subsectionsArray) { $sectionsArray[] = [ 'name' => $sectionName, 'nameDisplay' => $this->getSectionLabelBySectionName($sectionName), ]; } return $sectionsArray; } public function getSettingDetailsFlat(): array { $settingDetailsFlatArray = []; foreach($this->getSettingDetails() as $sectionsArray) { foreach($sectionsArray as $subsectionsArray) { foreach($subsectionsArray as $settingDetail) { $settingDetailsFlatArray[] = $settingDetail; } } } return $settingDetailsFlatArray; } public function getSectionLabelBySectionName(string $sectionName): string { return $this->getSectionLabels()[$sectionName]; } }