Ma commande CRUD me renvoie une érreur

Par Timothee Ngu, il y a 9 ans


Bonjour,

Je viens de créer un nouveau projet sur symfony 3. J'ai ajouter un nouveau bundle AppAdminBundle et créé l'entity Category. Lorsque je lance la commande doctrine

php bin/console doctrine:generate:crud //sur l'entity Category

j'ai ce message

[RuntimeException] Entity "Category" does not exist in the "AppAdminBundle" bundle. You may have mistyped the bundle name or maybe the entity doesn't exist yet (create it first with the "doctrine:generat e:entity" command).

Mon entity Category.php est bien créé et existe dans le dossier Entity de mon bundle.

help please

6 réponses

Timothee Ngu, il y a 9 ans

Salut la commande app/console n'est plus utilié dans symfony 3. pour info, ma synthaxe est correct.

Tapion, il y a 9 ans

@GhostCheater ça bien de tout lire aussi
"If your application is based on Symfony 3, replace php app/console by php bin/console before executing any of the console commands included in this article."

@TimotheeNgu

J'ai le même soucis que toi sur la v3 (3.1.9/3.1.10) probablement un bug mais essaie comme ça, ça marche :

php bin/console doctrine:generate:crud --entity=AppAdminBundle:Category
Timothee Ngu, il y a 9 ans

Bonjour Flay0r, ca ne marche toujours pas.

C:\wamp\www\trans>php bin/console doctrine:generate:crud --entity=AppAdminBundle:Pays Welcome to the Doctrine2 CRUD generator This command helps you generate CRUD controllers and templates. First, give the name of the existing entity for which you want to generate a CRUD (use the shortcut notation like AcmeBlogBundle:Post) The Entity shortcut name [AppAdminBundle:Pays]: [RuntimeException] Entity "Pays" does not exist in the "AppAdminBundle" bundle. You may have mistyped the bundle name or maybe the entity doesn't exist yet (create it first with the "doctrine:generate:entity" co mmand). doctrine:generate:crud [--entity ENTITY] [--route-prefix ROUTE-PREFIX] [--with-write] [--format FORMAT] [--overwrite] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<entity>]
Tapion, il y a 9 ans

Tu as bien mis les namespaces ?

Timothee Ngu, il y a 9 ans

Oui, j'ai mis tous les namespaces

Tapion, il y a 9 ans

Et tu peux me montrer ton fichier "Entity" qui ne marche pas stp ?