getUserContainer()->getRepositoryQuery(); } public function createEntity(string $entityFqcn) { return $this->getUserContainer()->getFactory()->create(); } public function configureFields(string $pageName): iterable { $fields = $this->get(UserContainer::class) ->getFieldDefinition() ->setMerchant($this->getMerchantCurrent()) ->getAllFields(); if($pageName == Crud::PAGE_INDEX){ return [ $fields['id'], $fields['gender'], $fields['lastname'], $fields['firstname'], $fields['email'], $fields['phone'], $fields['birthdate'], $fields['groupUsers'], $fields['isSaleAlwaysOpen'], $fields['newsletters'] ]; }elseif($pageName == Crud::PAGE_EDIT || $pageName == Crud::PAGE_NEW){ $fieldToReturn = [ $fields['id'], $fields['gender'], $fields['lastname'], $fields['firstname'], $fields['email'], $fields['phone'], $fields['birthdate'], $fields['groupUsers'], $fields['isSaleAlwaysOpen'], $fields['newsletters'] ]; if($this->isGranted('ROLE_SUPER_ADMIN')){ $fieldToReturn[] = $fields['roles']; } return $fieldToReturn; } } }