On 17 June 2014 11:26, <[email protected]> wrote:

> Is there a fundamental Doctrine reason not to allow arbitrary non-PK joins
> between entities?
>

You can actually build arbitrary joins via DQL, joining with any condition
you want:

SELECT f, b FROM Foo f JOIN Bar b WITH f.someField = b.otherField

It is not possible to build object references through association fields
that don't reference primary keys. That is the case because the ORM tracks
instances via their identifiers in its internal identity map.
When getting a reference to any object that isn't yet loaded, the ORM needs
to build a stub of that object and be able to load it later on (a proxy).
To keep track of that object and load it, it needs an identifier.
Therefore, your association must include all identifier fields in order to
work correctly within the ORM.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to