get(OpeningContainer::class)->getRepositoryQuery(); } public function configureFields(string $pageName): iterable { $fields = parent::configureFields($pageName); return array_merge( [ ChoiceField::new('day') ->setRequired(true) ->setChoices( [ 'Lundi' => 1, 'Mardi' => 2, 'Mercredi' => 3, 'Jeudi' => 4, 'Vendredi' => 5, 'Samedi' => 6, 'Dimanche' => 7, ] ), TimeField::new('timeStart') ->setRequired(false) ->setFormat('H:mm'), TimeField::new('timeEnd') ->setRequired(false) ->setFormat('H:mm'), AssociationField::new('groupUser'), ], $fields ); } public function configureCrud(Crud $crud): Crud { $crud = parent::configureCrud($crud); $crud->setDefaultSort(['day' => 'ASC']); return $crud; } public function createEntity(string $entityFqcn) { return $this->getOpeningContainer() ->getFactory() ->create($this->getSectionCurrent()); } }