xpdo
xpdo copied to clipboard
getOne behaviour changes with Criteria
$xpdoObject->getOne is promoted as
Gets an object related to this instance by a foreign key relationship
However if you supply a Criteria or Query as the second parameter, that default behaviour is lost unless you manually specify the relationship in the criteria.
I feel that getOne should always enforce the foreign key relationship. This would mean the criteria parameter would automatically have the foreign key added to it. The criteria parameter should always be additive and not entirely forget the relationship previously specified in the XML schema.