Forums / Setup & design / Greater than or equal operator for depth?

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

eZ debug

Timing: Jan 18 2025 19:17:43
Script start
Timing: Jan 18 2025 19:17:43
Module start 'content'
Timing: Jan 18 2025 19:17:44
Module end 'content'
Timing: Jan 18 2025 19:17:44
Script end

Main resources:

Total runtime1.1842 sec
Peak memory usage4,096.0000 KB
Database Queries215

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 587.8516180.8125
Module start 'content' 0.00800.9827 768.6641711.8828
Module end 'content' 0.99080.1933 1,480.5469340.4297
Script end 1.1841  1,820.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.3545210.0002
Check MTime0.00160.1316210.0001
Mysql Total
Database connection0.00170.142010.0017
Mysqli_queries1.066090.01842150.0050
Looping result0.00230.19402130.0000
Template Total1.149397.120.5746
Template load0.00250.213220.0013
Template processing1.146796.841120.5734
Template load and register function0.00020.019010.0002
states
state_id_array0.00090.074810.0009
state_identifier_array0.00130.112420.0007
Override
Cache load0.00220.1874620.0000
Sytem overhead
Fetch class attribute can translate value0.00150.123160.0002
Fetch class attribute name0.00140.1182110.0001
XML
Image XML parsing0.00380.319660.0006
class_abstraction
Instantiating content class attribute0.00000.0025140.0000
General
dbfile0.00510.4348380.0001
String conversion0.00000.000630.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 6

Time used to render debug report: 0.0003 secs