mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Entities not detected with aliased namespace imports. #6693
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 @aik099 on GitHub (Apr 13, 2021).
The entity class (generated mostly by DQL plugin of PhpStorm):
Here is how Doctrine ORM is initiated:
Attempt to use
orm:schema-tool:createcommand doesn't create any entities, because instead of resolving@ORM\Entitywith the above presentuse Doctrine\ORM\Mapping as ORM;line toDoctrine\ORM\Mapping\Entityclass it resolves it toDoctrine\ORM\Mapping\ORM\Entityclass. Since it doesn't exist it's being ignored.This happens likely due fact, that the simple annotation manager has initialized with a hardcoded
Doctrine\ORM\Mappingnamespace and isn't aware of theORMalias under which it's imported.P.S.
I'm just starting to work with Doctrine ORM, so please excuse my stupid question.
@beberlei commented on GitHub (Apr 13, 2021):
Yes this is how the simple annotation reader works. I believe this is documented, but don't expect any large changes in this, since with PHP 8 attributes, annotations are sort of reaching their end of life