[ self::SUBSECTION_GENERAL => [ new AdministratorEmailAdminSetting, new AdministratorPhoneNumberAdminSetting, ] ], ]; } public function getSectionLabels(): array { return [ self::SECTION_GENERAL => 'General', self::SUBSECTION_GENERAL => 'General', ]; } 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]; } }