sectionStore = $sectionStore; $this->newsletterStore = $newsletterStore; } public function configureIndex(): array { return $this->addSectionToFieldArrayIfOutOfSection($this->section, parent::configureIndex()); } public function configurePanelMain(): array { return array_merge(['section'], parent::configurePanelMain()); } public function configureFields(): array { $fieldArray = parent::configureFields(); if(is_null($this->newsletterArray)){ $this->newsletterArray = $this->newsletterStore ->setSection($this->section) ->setMerchant($this->merchant) ->get(); } $fieldArray['newsletter']->setFormTypeOption('choices', $this->newsletterArray); return $fieldArray; } }