mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Use @ORM alias optionally #5923
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @javiertrejo on GitHub (Mar 15, 2018).
Originally assigned to: @Ocramius on GitHub.
It's a good idea use the alias @ORM as an optional parameter configuration when run the cli command to generate the Entities.
Using Doctrine Stand alone the @ORM causes a MappingException
For Example:
First i run the cli command to generate the entities:
./sbin/doctrine orm:convert-mapping --extend 'Itsg\Core\Base\AbstractObject' --namespace 'App\Personal\Entity\' --force --from-database annotation opt/This is an example of a generated entity:
When i try to get the default repository i have an error:
MappingException
Class "App\Personal\Entity\DfForms" sub class of "Itsg\Core\Base\AbstractObject" is not a valid entity or mapped super class.
The problem solves if i remove the @ORM alias from use line and annotations lines.
@Ocramius commented on GitHub (Mar 15, 2018):
We've deprecated and removed the entity generator in the next major: no more improvements will be applied.
This is because you have two different annotation drivers there, of which one is configured with a simplified annotation reader. We're removing that one too, so you should always import your annotations.