Greater than or equal operator for depth?

Author Message

James Packham

Tuesday 27 January 2004 7:59:22 am

Hi, can anyone tell me what the "greater than or equal" ( >= ) operator is? For example what would I have to replace gte with in the following fetch statement:

...
'depth', 3,
'depth_operator', 'gte',
...

Thanks,

James

Alex Jones

Tuesday 27 January 2004 8:20:20 am

I believe it is 'ge'.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

James Packham

Tuesday 27 January 2004 8:47:33 am

No... This doesn't seem to work... Thanks for the quick response though! :)

It seems that when I experiment with different possiblities (ge, gte) they get ignored, showing me the nodes at all depths (even if less than the depth I specify). I would guess that "grater than" and "greater than or equal to" have been not been fully implemented yet, or have a bug in ezp version 3.3-2. Has anyone else had any experiences they could share?

Regards,

James

Paul Forsyth

Tuesday 27 January 2004 8:57:12 am

You may have the context wrong. Look here for how to use 'ge':

http://ez.no/ez_publish/documentation/development/libraries/ez_template/operators/logical_handling

James Packham

Tuesday 27 January 2004 9:40:07 am

Thanks Paul, but I think those examples are all for working in an equation. I'm trying to work with a fetch statement, so I've no variable to compare it with.

According to the documentation this is posisble (depth defaults to le and I'm am currently using eq to fullfil my needs, though this hinders my future development plans) though it doesn't specify the operators which can be used. The docs I'm referring to are:

http://www.ez.no/ez_publish/documentation/customization/ez_publish_api_documentation/module_function_definition_content

<snip>

[depth]
description - The depth of subnodes to recurse in the subnode tree.
type - integer
required - false
default - 1
[depth_operator]
description - An operator that used to work out which noes to display.
type - string
required - false
default - 'le'

</snip>

Thanks for your help :)

Regards.

~James~

Hans Melis

Tuesday 27 January 2004 10:05:31 am

Hi James,

I just had a look at the source code, and the only supported depth operator is actually 'eq' (equals). This one results in "depth = $nodeDepth" in the SQL.

Anything else as depth operator results in "depth <= $nodeDepth" ('le' type comparison) in the SQL.

I don't know why the other operators haven't been implemented, but I can't see any reason why they can't be added either.

--
Hans

Hans
http://blog.hansmelis.be

James Packham

Wednesday 28 January 2004 2:57:00 am

Hmmm looking at the code I could create an extension to replace the existing ezcontentobjecttreenode.php but it isn't really something I have time to do right now and seeing as I already have a workaround I'll probably leave it for another time.

Thanks for your help though!

Regards,

~James~

David Eriksson

Tuesday 19 July 2005 5:28:04 am

Is this still an issue? I'm having the same problem, in that only eq seems to work, and gt behaving like a less than. (3.6.0)

Luckily I only need two depths, so a quick workaround is possible by using two fetches and a merge, but at the very least the new documentation should be fixed.

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/tree

/David

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 22:21:15
Script start
Timing: Jan 18 2025 22:21:15
Module start 'layout'
Timing: Jan 18 2025 22:21:15
Module start 'content'
Timing: Jan 18 2025 22:21:15
Module end 'content'
Timing: Jan 18 2025 22:21:15
Script end

Main resources:

Total runtime0.8675 sec
Peak memory usage4,096.0000 KB
Database Queries78

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.0469152.6406
Module start 'layout' 0.00660.0034 740.687539.4766
Module start 'content' 0.01000.8561 780.1641706.7891
Module end 'content' 0.86600.0015 1,486.953120.1250
Script end 0.8675  1,507.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3468160.0002
Check MTime0.00130.1500160.0001
Mysql Total
Database connection0.00050.063110.0005
Mysqli_queries0.792591.3445780.0102
Looping result0.00080.0878760.0000
Template Total0.838796.720.4193
Template load0.00210.247820.0011
Template processing0.836596.423720.4183
Template load and register function0.00010.009110.0001
states
state_id_array0.00100.117310.0010
state_identifier_array0.00080.092720.0004
Override
Cache load0.00180.2063620.0000
Sytem overhead
Fetch class attribute can translate value0.00050.061450.0001
Fetch class attribute name0.00100.1149110.0001
XML
Image XML parsing0.00160.183750.0003
class_abstraction
Instantiating content class attribute0.00000.0031140.0000
General
dbfile0.00110.1291270.0000
String conversion0.00000.000940.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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: 30
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs