object relation in attribute filer

Author Message

Romeo Antony

Sunday 24 October 2010 6:19:12 am

I couldn't set up an objectrelation in attribute filter for the fech functions. can anyone please tell me a single line of code to show how to set it up in fetch functon

André R.

Sunday 24 October 2010 3:16:55 pm

If it is object relation list (plural relation datatype), then you need to use extended attribute filter, there are at least a few on projects.ez.no. If it is object relation, then you should be able to use attribute filter with object id's for filter value(s).

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

Romeo Antony

Monday 25 October 2010 12:40:57 am

thank you Andre, I have got the examples you mentioned from ez.no

{fetch( 'content',
'list',
hash( 'parent_node_id', 42,
'attribute_filter', array( array( 'article/image',
'=',
87 ) ) ) )}
This example demonstrates how to do attribute filtering using an attribute of the "Object relation" datatype. Only article nodes that store relation to the specified content object (object ID = 87) in their "image" attribute will be included in the result.

Sander van den Akker

Friday 11 February 2011 8:55:37 am

*bump*

Currently I ran into this limitation of the object relation list datatype. Is there a particular reason why it doens't support filtering?

I tried to find a filter on projects.ez.no without success. WHich filter do you mean exactly? Thanks!

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

Nicolas Pastorino

Friday 11 February 2011 9:29:48 am

Hi Sander,

Just checked shallowly, and found this : http://projects.ez.no/objectrelationfilter , may be of some help to you ?

Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Sander van den Akker

Sunday 13 February 2011 9:28:23 am

Ah yes,

I checked that one, but since the first line is talking about reverse relations I was assuming it wouldn't work for normal relations... but since this extended filter works using an attribute and object id as input, it should support my needs :)

Thanks!

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

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

eZ debug

Timing: Jan 18 2025 05:16:58
Script start
Timing: Jan 18 2025 05:16:58
Module start 'layout'
Timing: Jan 18 2025 05:16:58
Module start 'content'
Timing: Jan 18 2025 05:16:59
Module end 'content'
Timing: Jan 18 2025 05:16:59
Script end

Main resources:

Total runtime0.7386 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.9219152.6250
Module start 'layout' 0.00640.0036 740.546939.4688
Module start 'content' 0.01000.7270 780.0156666.2578
Module end 'content' 0.73700.0015 1,446.273416.1563
Script end 0.7385  1,462.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4348160.0002
Check MTime0.00130.1801160.0001
Mysql Total
Database connection0.00100.138910.0010
Mysqli_queries0.671090.8497700.0096
Looping result0.00090.1208680.0000
Template Total0.708695.920.3543
Template load0.00200.277020.0010
Template processing0.706595.657520.3533
Template load and register function0.00010.012310.0001
states
state_id_array0.00090.124910.0009
state_identifier_array0.00160.221620.0008
Override
Cache load0.00180.2414330.0001
Sytem overhead
Fetch class attribute can translate value0.00070.093940.0002
Fetch class attribute name0.00220.2982100.0002
XML
Image XML parsing0.00200.270640.0005
class_abstraction
Instantiating content class attribute0.00000.0035120.0000
General
dbfile0.00120.1629360.0000
String conversion0.00000.001840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs