Open inzanty opened 3 years ago
I managed to create an entity by giving it a full name, example: php bin/console make:entity Web\Test
. It's better to clarify this in the documentation here. Other variant, mention this when user create an entity via console.
To create entities the maker bundle needs the mapping information which are provided by doctrine.
When you are using 2 Entity Managers and have two mappings leading to App\Entity\Web
and App\Entity\Stats
, doctrine do not have any mapping for App\Entity
(could be that some default mapping exists but without type: annotation
, idk).
In case you are not using the FQCN, the maker-bundle should not use automatically which of your both mapping should be used to create the User
entity.
I think a better error message would be something like Creation of entity for the namespace "App\Entity\" failed. No doctrine mapping found for that namespace. Configured namespaces are "App\Entity\Web", "App\Entity\Stats", "...". Create a new mapping for namespace "App\Entity\" or enter the FQCN of the entity you want to create/update
.
Or we could provide a choice input in case we found multiple entity managers, where the user can select a namespace to create the entity for, in case no FQCN is provided in his input :)?
Symfony version(s) affected: 5.3.3
Description I need to define two entity managers and my config looks similar this:
How to reproduce If execute
php bin/console make:entity
command, i will get this error:Possible Solution Exactly don't know how to fix this problem.
Additional context