Fetching list of all distinct attribute values.

Author Message

Jan Komárek

Saturday 14 February 2009 6:04:49 pm

Hello

I need to fetch list of all distinct attribute values.
I have 3 degree adress district/region/city. District and regions are selectoboxes, but city is text box.
And costomer wants to have a filter with select box with cities, but there will be only cities which was filled in...
So I need to get all values of attribute.

SQL Like:
SELECT DISTINCT city FROM adress;

Thanks for help.

Łukasz Serwatka

Tuesday 17 February 2009 12:24:25 am

Hi,

You can try extended attribute filtering. http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list

You can alternatively write your own fetch function as well.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 31 2025 04:14:08
Script start
Timing: Jan 31 2025 04:14:08
Module start 'layout'
Timing: Jan 31 2025 04:14:08
Module start 'content'
Timing: Jan 31 2025 04:14:08
Module end 'content'
Timing: Jan 31 2025 04:14:08
Script end

Main resources:

Total runtime0.0161 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.2656151.2266
Module start 'layout' 0.00610.0021 739.492236.6953
Module start 'content' 0.00820.0068 776.187590.1875
Module end 'content' 0.01490.0012 866.375029.9922
Script end 0.0161  896.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002616.3968140.0002
Check MTime0.00117.0768140.0001
Mysql Total
Database connection0.00106.313910.0010
Mysqli_queries0.002112.992930.0007
Looping result0.00000.062110.0000
Template Total0.00095.310.0009
Template load0.00074.098810.0007
Template processing0.00021.196210.0002
Override
Cache load0.00052.809410.0005
General
dbfile0.002716.697080.0003
String conversion0.00000.031140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs