How to use fetch function like in the .tpl files

Author Message

Jun Zheng

Monday 24 November 2008 10:27:27 pm

Hi all,
I want to get some infomation using fetch function like in the template used.

$top_menu_items=fetch( 'content', 'list', hash( 'parent_node_id', $root_node.node_id,
                                                          'sort_by', $root_node.sort_array,
                                                          'class_filter_type', 'include',
                                                          'class_filter_array', ezini( 'MenuContentSettings', 'TopIdentifierList', 'menu.ini' ) ) )

But I don't know how to use it in the php file. I found the list function through the function_definition.php ,there are so many parameters,

function fetchObjectTree( $parentNodeID, $sortBy, $onlyTranslated, $language, $offset, $limit, $depth, $depthOperator,
                              $classID, $attribute_filter, $extended_attribute_filter, $class_filter_type, $class_filter_array,
                              $groupBy, $mainNodeOnly, $ignoreVisibility, $limitation, $asObject, $objectNameFilter, $loadDataMap = true )

I only want to use four parameters like in the template file or how to set the other parameters that i don't use. Want can i do ??

Kristof Coomans

Monday 24 November 2008 11:11:38 pm

Hi Jun

Lukasz wrote a nice blog article about this: http://serwatka.net/blog/fetching_ez_publish_content_objects_with_php. Some info is slightly outdated for eZ Publish 4, but there are remarks about that in the comments. Good luck!

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Forex System Profi

Wednesday 26 November 2008 2:52:10 am

> http://serwatka.net/blog/fetching_ez_publish_content_objects_with_php

Thank you, Kristof !

Metatrader Expert ( http://iticsoftware.com ), Scalping Forex ( http://iticsoftware.com/scalping-forex.php ), Forex Trading Systems ( http://shop.profxtools.com )

Jun Zheng

Wednesday 26 November 2008 7:06:27 pm

Wonderful blog!
Kristof ,Thank you very much!

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

Main resources:

Total runtime1.3855 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.0625152.6406
Module start 'layout' 0.00640.0028 740.703139.4766
Module start 'content' 0.00911.3748 780.1797581.5859
Module end 'content' 1.38400.0015 1,361.765612.4375
Script end 1.3855  1,374.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2485160.0002
Check MTime0.00140.1023160.0001
Mysql Total
Database connection0.00160.113010.0016
Mysqli_queries1.334396.3073620.0215
Looping result0.00080.0546600.0000
Template Total1.342696.920.6713
Template load0.00230.163520.0011
Template processing1.340396.741720.6702
Template load and register function0.00030.018410.0003
states
state_id_array0.00330.237510.0033
state_identifier_array0.00100.073720.0005
Override
Cache load0.00190.1359190.0001
Sytem overhead
Fetch class attribute can translate value0.00070.047330.0002
Fetch class attribute name0.00180.132650.0004
XML
Image XML parsing0.00080.059730.0003
class_abstraction
Instantiating content class attribute0.00000.000850.0000
General
dbfile0.00090.0614160.0001
String conversion0.00000.000540.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs