We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11793
    • 49 Posts
    I just realised that when you supply criteria for a getMany:

    $xpdoObject->getMany('My_Alias',$New_Criteria);


    You actually overwrite the original relational link defined for the alias in the XML. So you must include that original link with the new criteria:

    $xpdoObject->getMany('My_Alias',array('originalField'=>'originalValue', 'newCriteriaField'=>'newCriteriaValue' [ etc etc ]);


    Haven’t tested this on getOne() yet...

    XPDO from svn dated 8 Sep 2009, MODx 1.0, apache 2.2, php 5.
    • Yes, you are correct hardboiled; this was a conscious decision, since there are so many ways to build the same criteria, it would be close to impossible to know in all cases if you did include the original criteria defined for such a relationship and if xPDO injected this again, you could end up with duplicate expressions. Perhaps this would be harmless though; what do you think?