You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NewsletterFieldDefinition.php 1.0KB

преди 3 години
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. }