Doctrine @ORM\Entity
PermalinkLots of projects that are using the doctrine ORM entities. New entities are getting created, everything works fine.... well.... worked fine.
When I create a new entity class, it will not create any tables, because the @ORM part is not working anymore. Strange!
... use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="MyLittleTable") */ class Bladiebla { ...
When debugging it, I see that the doctrine part is looking for "\Doctrine\ORM\Mapping\ORM\Entity" which is not correct.
When I change it, it does work... (see below). What is happening? It was working before...
... /** * @\Doctrine\ORM\Mapping\Entity * @\Doctrine\ORM\Mapping\Table(name="MyLittleTable") */ class Bladiebla { ...
v8.5.2 (also in c8.4.x, not sure which version)
I've got a very simple package that will only create an entity with Doctrine ORM.
I've used this method several times, but suddenly it doesn't seem to work. It installs, but the entity was not created in the base.
If you use the full path for @ORM\..... (@\Doctrine\ORM\Mapping\....) then it will work. What is wrong?
See attached zip.
- c5 cache
- doctrine dev mode on/off (on the database entities page)
- c5 v5.7 vs v8 (changes in namespace resolution)
- package controller, autoloader registries set
It was in 8.5.2 (new installation) and 8.4.x (I updated to 8.5.2 because I had this strange behaviour)
As you can see the simple example package, nothing special at all...
And tried both Doctrine modes.
But I'll try again (and again and again ;-))
Thanx a lot. That was the thing that was missing! You saved my day. In all my other packages, I have 8.4.2 (or something similar).
Thanx a lot!
Just tries it on a clean 8.5.2 install. Custom entity class doesn't work with @ORM\Entity but it works just fine with @\Doctrine\ORM\Mapping\Entity.
Weird!