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->get(OpeningContainer::class) ->getFactory() ->create($this->get(SectionResolver::class)->getCurrent()); } }