I think I resolved my issue. It appears my problem was that my client code
was not maintaining the bidirectional nature of the relationship.
I added the following to my owner class:
/**
* Adds an access model to the access collection.
*
* @param access $access
*/
public function addAccess( access $access ) {
$this->accesses->add( $access );
}
And modified my access class like so:
/**
* Sets the owner.
*
* @param owner $owner
*/
public function setOwner( owner $owner ) {
$this->owner = $owner;
$owner->addAccess( $this ); // Added this line
}
I knew I needed to maintain bidirectional relationships manually if I
wanted to access entities from collections on the inverse side, but I
wasn't entirely clear that I needed to do this in order for DQL to
"correctly" populate those collections. I guess I thought because the
relationships are defined fully in YAML and doctrine uses some amount of
reflection that, for selecting entities with DQL, it would handle the
population for me.
--
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.