Handle doctrine resolved interfaces
Closed this issue · 2 comments
Im using doctrine's resolve interfaces (resolve target entity) ability to provide abstraction in my entities. The problem when I create a user this way:
It gives me an error when I do this:
Question\MyQuestionImplementaion\Question:
question{1..3}:
title: <realText(100)>
author: 1
text: <realText(2000)>
Question association looks like this:
@manyToMany(targetEntity="User\MyInterface\User")
Interface User\MyInterface\User
maps to User\MyImplementation\User
error I get is:
No ObjectManager for class User\MyInterface\User
Seems like issue is in h4cc\AliceFixturesBundle\ORM\Doctrine.php
How can I handle resolved interfaces?
Hi there,
i have never heard of the configuration you did with @manyToMany(targetEntity="User\MyInterface\User")
, because there does not seem to be a concrete class defined as targetEntity.
All i can do is ask the doctrine managerRegsitry for the manager of a given class:
https://github.com/h4cc/AliceFixturesBundle/blob/master/ORM/Doctrine.php#L118-L122
To me it sounds more like a problem with doctrine, because doctrine does not seem to know about your User\MyInterface
namespace, so it can not provide a manager for that.
Please provide more information, if this issue still persists.