php - Symfony2 and Doctrine - OneToMany returns only one result -
I have towel organizations, submissions and submission history
Any ideas why?
There are institutions in the IP>
// entry submissions / ** * @ORM \ OneToMany (targetEntity = "SubmissionHistory", mapped = "submissions") * / $ $ protected ; Public function __ composition () {$ this- & gt; History = new ArrayCollection (); } / ** * Get History * * @Riton's Principle / Common Collections * / Public Function getHistories () {Return $ this- & gt; History; } After that,
// unit submission / ** * @ORM \ ManyToOne (targetEntity = "submission", inverted = "history" ) * @ORM \ JoinColumn (name = "hash_key", referenced columnname = "hash_key") * / protected $ submission; / ** * Receive Submissions * * * Return Cyfrom \ Version 2 Bundle \ Unit \ Submissions * / Public Function getSubmission () {Return $ -> Submit; }
I got the problem:
I set up the setup ID There must be a hash in the submissions history , which is incorrect, by doing so, all the results have been collapsed as if I am grouping them with "field.id". By changing the ID field to ID, things work perfectly well.
Comments
Post a Comment