Share » Forums » Developer » Reverse Object Relations

Reverse Object Relations

Reverse Object Relations

Wednesday 30 January 2008 5:04:54 am - 4 replies

Author Message

Felix Laate

Wednesday 30 January 2008 11:54:17 am

Hi Josh!

Welcome to the community!

A good place to start would be here:

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/reverse_related_objects

This function supports attribute filtering as well.

Cheers!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

josh rowley

Thursday 31 January 2008 1:56:37 am

Thanks Felix!

However, I have seen that document already and it doesn't look like I can fetch by multiple relations.

The only way I can see to do this, as underneath the objectrelations datatype uses XML in the data_text field to store the relations, is to do multiple fetches ( one per relation I want to match on ) and then build an array of node_ids that have objects which match all 3 requests.

Pretty inefficient.. Another way I can think is to create a new datatype which uses the object link table instead of XML.. but I wonder if there are any solutions out there which will already work with a simple fetch using attribute filters.

Josh

André R.

Thursday 31 January 2008 3:27:50 am

object relationlist already use the object link table, look at this extension for code (it uses the extended object attribute filter for relations filtering).

Relations filter ( comment by Kristof Coomans ):
http://ez.no/developer/contribs/template_plugins/objectrelationfilter

Reverse relations filter:
http://pubsvn.ez.no/community/trunk/extension/objectrelationfilter/classes/objectrelationfilterandinv.php

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

John Kazakis

Thursday 12 June 2008 8:49:54 am

Hello,

Is there a way to fetch reverse_related_objects AND related_objects? Or do I have to use 2 separate fetches?

Thanks.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu