例如,如果我有:
class Parent {
/* ... */
/** One to Many association */
protected $children;
}
class Child
{
/* .. */
/** many to one association */
protected $parent;
/* name of child column */
protected $name;
}
现在,假设父母,我想按孩子的名字过滤孩子。如果可能,以某种方式使用此过滤器执行 parent.getChildren() 会很好,但这是不可能的。
我希望它可能具有 getChildrenByName() 语法,但这个函数似乎不适合 ORM 类和它的存储库类。有没有人有什么建议?