Forums / General / Object Relations / Comment32124

Author Topic

Xavier Dutoit

Tuesday 30 August 2005 3:39:21 am

Comment32124

Hi Kirill,

I'm the person who created the enhanced object relation, so I feel like I'm able to disagree with you when you says that "It never returned reverse related objects made by content object attributes [...]as they were not stored in a corresponding database table" ;)

The eor did that, and one of the main reason to create it was to be able to get the relations set by an attribute into related_contentobject_array and reverse.

As Gabriel said, the best solution IMO is to list all the relations into the arrays (and counts). As it doesn't seem to be an option,I suggest :

1) To add a new boolean parameter (all) to the existing fetch functions
reverse_related_objects_count, reverse_related_objects.

by defaut, that's false, and it you true() it, it will fetch all the relations, no matter the attribute.

{def $objects_count=fetch( content, reverse_related_objects_count, hash( object_id, $node.contentobject_id, all, true() ) )}

2) to add two new fetch functions related_objects_count and related_objects
With the same arguments than the reverse_related ones

3) to obsolete the arrays into the node.

Any thought ?

X+

http://www.sydesy.com