I have a symfony 2.4.x project.
It has two objects that appear together: Conference and Paper.
In each conference there are documents and with a special conference, I would like to receive the number of documents.
For this, in my conference organization, I:
protected $papers;
In the document of the document that I have:
/** * @ORM\ManyToOne(targetEntity="Conference", inversedBy="papers") * @ORM\JoinColumn(name="conference_id", referencedColumnName="id") */ protected $conference;
When I had this project on Symfony2.0, everything worked fine, but now I ported it to Symfony 2.4.x, and when trying to do the following:
count($conf->getPapers());
Mistake:
ContextErrorException: Notice: Undefined index: hash_key in /var/www/git/conference2.0-v2.4/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 121
EDIT: Here are the full classes of two objects in pastebin:
EDIT 2: Here are some news I found trying to solve a problem. There is another class involved: Performance.
Here is the code: http://pastebin.com/bkdRtjdq
In the class view, I have a hash_key primary key, not an id.
php symfony entity twig doctrine2
Miloลก
source share