rolesDefinition = $rolesDefinition; } public function configureFieldsIndex(): array { return [ 'id', 'gender', 'lastname', 'firstname', 'email', 'groupUsers' ]; } public function configureFieldsForm(): array { return [ 'id', 'gender', 'lastname', 'firstname', 'email', 'phone', 'birthdate', 'groupUsers' ]; } public function configurePanels(): array { return []; } public function configureFields(): array { return [ 'id' => IntegerField::new('id')->onlyOnIndex()->setSortable(true), 'gender' => ChoiceField::new('gender')->setChoices( $this->translatorAdmin->transChoices(UserSolver::getGenderChoices(), 'User', 'gender') ) ->setFormTypeOption('expanded', true) ->setFormTypeOption('multiple', false) ->setSortable(true), 'lastname' => TextField::new('lastname')->setSortable(true), 'firstname' => TextField::new('firstname')->setSortable(true), 'email' => TextField::new('email')->setSortable(true), 'phone' => TextField::new('phone')->setSortable(true), 'birthdate' => DateField::new('birthdate')->setSortable(true), 'groupUsers' => AssociationField::new('groupUsers')->setSortable(true), 'roles' => ChoiceField::new('roles') ->allowMultipleChoices() ->autocomplete() ->setChoices($this->rolesDefinition->getRolesList()), ]; } }