DDC-2667: Collections for OneToMany&ManyToMany relations generated by entity's repository #3404

doctrinebot opened this Issue Sep 10, 2013 · 0 comments

2 participants


Jira issue originally created by user morgen:

The ArrayCollection object for OneToMany or ManyToMany relations is
generated by Doctrine. There is no ability within entity to get acces to it's repository.

This would be very useful nice to specify additionally the method in entity's repository, which could generate collection for the given entity.

An example annotation
/*** @ORM\OneToMany(targetEntity="Person", repositoryMethod="findAllowedPersons") **/
private $persons;


  • optimized query for collection (or even php script)
  • generation of collections can depends on external parameters or internal fields


  • for such collections adding/removing of elements is not allowed or has be limited
@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment