Forums / Developer / Attribute level filtering on enhanced object relation

Attribute level filtering on enhanced object relation

Author Message

Bertrand Dunogier

Tuesday 20 September 2005 7:21:55 am

I have a project content class, with district, location and area attributes; these attributes are enhanced object relations, entered using single select list.

I'd like to search every project in location X and / or district Y and / or area Z (an area belongs to a location and a location belongs to a district, so the and / or part is not critical... ^^)

Anyway I'm having a BIG headache on the search engine and it's attribute level search. Sometimes I get relevant results, sometimes not... really depends on my search.

Now I'm trying to build custom lists using content/list and attribute_filter, but so far, not good...

fetch('content', 'list', hash(..., attribute_filter, array(array('projet/commune', '=', '???')))

As far as I understand it, I can't use the city name, since EOR stores object IDs, but since it stores a list, I can't use the ID itself either...

Any suggestion ? I'm about to rip my head apart ;)

Xavier Dutoit

Wednesday 21 September 2005 4:03:54 am

Hi,

The easiest seem to be to get the list of the reverse related objects to a district, location or area as eor stores the district, location or area as related objects.

With 3.6.x, you have template operators for that. Have a look at the contrib page, that should give you some hints.

X+

http://www.sydesy.com

eZ debug

Timing: Jan 18 2025 16:25:25
Script start
Timing: Jan 18 2025 16:25:25
Module start 'content'
Timing: Jan 18 2025 16:25:26
Module end 'content'
Timing: Jan 18 2025 16:25:26
Script end

Main resources:

Total runtime0.7017 sec
Peak memory usage4,096.0000 KB
Database Queries55

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.3047180.8125
Module start 'content' 0.00710.6919 770.1172525.9531
Module end 'content' 0.69900.0027 1,296.070342.2266
Script end 0.7017  1,338.2969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4569140.0002
Check MTime0.00150.2208140.0001
Mysql Total
Database connection0.00060.087210.0006
Mysqli_queries0.666694.9912550.0121
Looping result0.00050.0710530.0000
Template Total0.673095.920.3365
Template load0.00200.283920.0010
Template processing0.671095.628320.3355
Template load and register function0.00030.038010.0003
states
state_id_array0.00130.178910.0013
state_identifier_array0.00070.095220.0003
Override
Cache load0.00170.2369160.0001
Sytem overhead
Fetch class attribute can translate value0.00050.073520.0003
Fetch class attribute name0.00120.171330.0004
XML
Image XML parsing0.00050.072320.0003
class_abstraction
Instantiating content class attribute0.00000.001430.0000
General
dbfile0.00070.1013180.0000
String conversion0.00000.001030.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs