String search

Author Message

Sao Tavi

Thursday 14 April 2011 4:59:09 am

I have an extension that uses a custom table. I want to be able to search in that table for row that have column matching a string. I've read about fetch functions and eZ Find but I couldn't find what I was looking for, so I have several questions:

1)
eZ Find supports custom tables? Is there a resource that can explain this in more detail? I've read the tutorials on ez publish, but there was nothing of this kind...

2)
How can I use a Fetch function to search for a string using wildcard, make case insensivite search? I am using the function below, but it returns only exact matches.

public static function fetchByField1Field2( $field1 , $field2, $asObject = true)
    { 
        $result = eZPersistentObject::fetchObjectList(  
                                                    self::definition(), 
                                                    null, 
                                                    array( 'colum1' => $field1, 
                                'column2' => $field2 ), 
                                null,
                                array('length', 5),
                                                    $asObject, 
                                                    false, 
                                                    null ); 
 
        return $result; 
    }

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 10:36:16
Script start
Timing: Jan 18 2025 10:36:16
Module start 'layout'
Timing: Jan 18 2025 10:36:16
Module start 'content'
Timing: Jan 18 2025 10:36:17
Module end 'content'
Timing: Jan 18 2025 10:36:17
Script end

Main resources:

Total runtime0.0181 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.0060 587.7891152.6094
Module start 'layout' 0.00600.0032 740.398439.4063
Module start 'content' 0.00920.0066 779.804785.3203
Module end 'content' 0.01580.0023 865.125030.2891
Script end 0.0181  895.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002614.3280140.0002
Check MTime0.00126.7319140.0001
Mysql Total
Database connection0.00158.457610.0015
Mysqli_queries0.002815.682830.0009
Looping result0.00000.110510.0000
Template Total0.00189.710.0018
Template load0.00094.925910.0009
Template processing0.00094.765510.0009
Override
Cache load0.00063.476410.0006
General
dbfile0.00147.965780.0002
String conversion0.00000.051340.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