Attribute_filter on object relations datatype

Author Message

Romain Dausset

Tuesday 29 May 2007 4:42:48 am

Dear all,

I'm trying to fetch children of a node filtered by their objects in relation.

Example :
Object to fetch is in relation with 2 other objects by the "object relations" datatype.
Object to fetch -> datatype object relation -> 1. Object ( id = 162 )
-> 2. Object ( id = 160 )

To get the objects which have a relation with object id = 162, I've tried this code :

{def $children=fetch( 'content', 'list', hash( 'parent_node_id', 166,
                             'sort_by', array( 'name', true() ),
                             'limit', $number_of_items,
                             'offset', $view_parameters.offset
                             'attribute_filter', array( array( 'user/agence',
                                        '=',
                                        162 ) )
                             ) )}

"agence" is the attribute relation of my user class.

Using this code doesn't return any objects.

I've based my code on the example 11 in the fetch documentation :
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/list

Any ideas ?

Thx Rom.

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

André R.

Tuesday 29 May 2007 5:59:17 am

Is user/agence a objectrelation or objectrelations(list) ?
The last one does not support attribute filtering.

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

Romain Dausset

Wednesday 30 May 2007 5:26:59 am

It's a objectrelations(list)... :(

So, I found a solution using several fetches and loops ^^
Not very clean, but working.

See ya,
Rom.

--
Romain Dausset

rdausset@facileit.com

http://www.facileit.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.