|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
-
- namespace Lc\PietroBundle\Definition\Field\Workshop;
-
- use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\EmailField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\PietroBundle\Repository\Workshop\EntryStore;
- use Lc\PietroBundle\Repository\Workshop\WorkshopStore;
- use Lc\SovBundle\Definition\Field\AbstractFieldDefinition;
- use Lc\SovBundle\Field\BooleanField;
- use Lc\SovBundle\Translation\TranslatorAdmin;
-
- class EntryFieldDefinition extends AbstractFieldDefinition
- {
- protected WorkshopStore $workshopStore;
-
- public function __construct(TranslatorAdmin $translatorAdmin, WorkshopStore $workshopStore)
- {
- parent::__construct($translatorAdmin);
- $this->workshopStore = $workshopStore;
- }
-
- public function configureIndex(): array
- {
- return [
- 'workshop',
- 'firstname',
- 'lastname',
- 'organization',
- 'city',
- 'email',
- 'phone',
- 'isAnimator'
- ];
- }
-
- public function configureFields(): array
- {
- $workshopArray = $this->workshopStore->get();
-
- return [
- 'workshop' => AssociationField::new('workshop')
- ->setFormTypeOption('choices', $workshopArray),
- 'firstname' => TextField::new('firstname'),
- 'lastname' => TextField::new('lastname'),
- 'organization' => TextField::new('organization'),
- 'city' => TextField::new('city'),
- 'email' => EmailField::new('email'),
- 'phone' => TextField::new('phone'),
- 'isAnimator' => BooleanField::new('isAnimator'),
- ];
- }
- }
|