fetch search in extension

Author Message

Nathalie Grimaud

Thursday 02 February 2006 6:05:07 am

In an extension I need to make a search.
In a template I would use :

{def $results=fetch( 'content', 'search', 
  hash( 'text',  'product',
           'class_id',  37,
           'class_attribute_id', 262,
           'subtree_array', array('208') ) )}

What's the equivalent in an extension ?
I tried this but I've got wrong results :

$text = 'product';
$params = array(
		'ClassId' => '37',
		'ClassAttributeId' => '262',
		'SubtreeArray' => array( '208' )
		 ); 
$results =& eZSearch::search( $text , $params );

Nathalie Grimaud

Tuesday 07 February 2006 2:03:09 am

Is there any documentation on ez classes ?
Where can I find help to develop extensions ?

Nathalie Grimaud

Wednesday 15 February 2006 2:43:38 am

I finally found my answer looking in the kernel code...

$text = 'product';
$params = array(
'SearchContentClassID' => 37,
'SearchContentClassAttributeID' => 262,
'SearchSubTreeArray' => array( 208 )
); 
$results =& eZSearch::search( $text, $params);

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

Main resources:

Total runtime0.9589 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.0064 587.9141152.6250
Module start 'layout' 0.00640.0028 740.539139.4453
Module start 'content' 0.00920.9484 779.9844436.5156
Module end 'content' 0.95760.0012 1,216.50008.1641
Script end 0.9588  1,224.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3651160.0002
Check MTime0.00170.1751160.0001
Mysql Total
Database connection0.00110.114010.0011
Mysqli_queries0.917595.6906550.0167
Looping result0.00060.0677530.0000
Template Total0.926496.620.4632
Template load0.00210.221220.0011
Template processing0.924396.395220.4621
Template load and register function0.00020.024310.0002
states
state_id_array0.00140.147810.0014
state_identifier_array0.00200.213520.0010
Override
Cache load0.00180.1838150.0001
Sytem overhead
Fetch class attribute can translate value0.00070.068210.0007
Fetch class attribute name0.00130.131430.0004
XML
Image XML parsing0.00010.012610.0001
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00060.0663100.0001
String conversion0.00000.000740.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs