您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

NewsletterFieldDefinition.php 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Lc\CaracoleBundle\Definition\Field\Newsletter;
  3. use Lc\CaracoleBundle\Definition\Field\FieldDefinitionTrait;
  4. use Lc\CaracoleBundle\Repository\Section\SectionStore;
  5. use Lc\SovBundle\Definition\Field\Newsletter\NewsletterFieldDefinition as SovNewsletterFieldDefinition;
  6. use Lc\SovBundle\Translation\TranslatorAdmin;
  7. class NewsletterFieldDefinition extends SovNewsletterFieldDefinition
  8. {
  9. use FieldDefinitionTrait;
  10. protected SectionStore $sectionStore;
  11. public function __construct(TranslatorAdmin $translatorAdmin, SectionStore $sectionStore)
  12. {
  13. parent::__construct($translatorAdmin);
  14. $this->sectionStore = $sectionStore;
  15. }
  16. public function configureIndex(): array
  17. {
  18. return $this->addSectionToFieldArrayIfOutOfSection($this->section, [
  19. 'id',
  20. 'title',
  21. 'isMain',
  22. 'status'
  23. ]);
  24. }
  25. public function configurePanelMain(): array
  26. {
  27. return array_merge(['section'], parent::configurePanelMain());
  28. }
  29. }