Forums / General / Object Relations / Comment32125

Author Topic

Gabriel Ambuehl

Tuesday 30 August 2005 4:35:44 am

Comment32125

I fully agree with Xavier here. It did in FACT return everything (simply because it didn't know about the attribute_id stuff Xavier had added way back when enhancedobjectrelation was first implemented).

So in essence, you didn't preserve backward compatibility with this (at least not in all ways).

I still think that the admin interface should display them all (for reasons pointed out above, it did so in the past) as it's rather confusing for people not to see the relations.

In order to keep the API as it is, why not simply interprete negative ints passed to the attribute_identifier parameter as a wildcard to return EVERYTHING? If adding a boolean for "return_all" is possible, that would be much preferred of course.

OTOH, a new function to deal with this things wouldn't be all bad either as then it could return a array of the following format:

$reverse_related_object=array();
$reverse_related_object['contentobject_level']=array(/*all non attribute specific relations/*)
$reverse_related_object['attribute_identifier#1']=array(/*all  attribute specific relations for attribute_identifier#1/*)
$reverse_related_object['attribute_identifier#2']=array(/*all  attribute specific relations for attribute_identifier#2/*)

Or maybe, providing the same info but in a different structure:

$reverse_related_object=array();
$reverse_related_object[]=array("attribute_idenfier",  $related_object)

Am I making sense?

And while we're at it, the analog functionality for "forward" relations could potentially be quite handy, too.

Visit http://triligon.org