Forums / Developer / object relation in attribute filer

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

eZ debug

Timing: Jan 18 2025 05:22:49
Script start
Timing: Jan 18 2025 05:22:49
Module start 'content'
Timing: Jan 18 2025 05:22:49
Module end 'content'
Timing: Jan 18 2025 05:22:49
Script end

Main resources:

Total runtime0.7510 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.8672180.8359
Module start 'content' 0.00640.6439 769.7031671.3359
Module end 'content' 0.65020.1007 1,441.0391341.0547
Script end 0.7510  1,782.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5292210.0002
Check MTime0.00140.1867210.0001
Mysql Total
Database connection0.00080.107710.0008
Mysqli_queries0.657387.52462070.0032
Looping result0.00180.23792050.0000
Template Total0.720796.020.3603
Template load0.00190.247920.0009
Template processing0.718895.715220.3594
Template load and register function0.00010.012510.0001
states
state_id_array0.00170.228610.0017
state_identifier_array0.00100.139520.0005
Override
Cache load0.00150.1961330.0000
Sytem overhead
Fetch class attribute can translate value0.00110.148950.0002
Fetch class attribute name0.00140.1887100.0001
XML
Image XML parsing0.01652.200850.0033
class_abstraction
Instantiating content class attribute0.00000.0033120.0000
General
dbfile0.01782.3656470.0004
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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