For example if I have :
class Parent {
/* ... */
/** One to Many association */
protected $children;
}
class Child
{
/* .. */
/** many to one association */
protected $parent;
/* name of child column */
protected $name;
}
Now, let's say for a parent, I want to filter the children by their name. If possible, somehow doing parent.getChildren() with this filter would be nice but that's impossible.
I'd like it to probably have the syntax getChildrenByName(), but this function seems unfitting for the ORM class and it's repository class. Does anyone have any suggestions?
This feature allows you to add criteria when fetching associations:
Working With Associations: Filtering Collections
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With