mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-202: Left Joining on an empty previous join results spl_object_hash warning #250
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 @doctrinebot on GitHub (Dec 8, 2009).
Jira issue originally created by user russ:
I've marked this as minor because it does not seem to affect anything, other than raising a PHP warning, but that in itself suggests something is amiss somewhere.
When joining twice (or more), all the joins must return some rows, else the warning:
is raised.
In my particular example, I am simulating a ManyToMany relationship via a join table, so have relations set up either side as OneToMany and ManyToOne. In order to retrieve the "many" records, I need to first join the link table, then join the records that the link table specifies.
If the link table join returns some rows then everything passes without incident, however if the link join returns no rows, then the above warning is raised.
@doctrinebot commented on GitHub (Dec 9, 2009):
Comment created by romanb:
Interesting. You're not initializing collections as arrays, are you?
I mean sth like this:
?
@doctrinebot commented on GitHub (Dec 9, 2009):
Comment created by romanb:
I will try to reproduce this.
@doctrinebot commented on GitHub (Dec 9, 2009):
Comment created by russ:
No, no parameter is being initialised.
Array hydration works fine also, so currently I have this rather interesting dql:
For reference, here are the other class annotations:
As you can see the only properties that are initialised (as null) are not annotated and are dealt with by the class internally. Could they have something to do with it?
@doctrinebot commented on GitHub (Dec 9, 2009):
Comment created by romanb:
I dont think so. Your code looks absolutely correct. I am working on this. I already got it reproduced in the test suite.
@doctrinebot commented on GitHub (Dec 9, 2009):
Comment created by romanb:
This should be fixed now in trunk.
@doctrinebot commented on GitHub (Dec 9, 2009):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 9, 2009):
Comment created by russ:
Works for me when I remove my workaround (above). Good stuff.