classes/ezfindelevateconfiguration.php
public static function fetchObjectsForQueryString( $queryString, $groupByLanguage = true, $languageCode = null, $limit = null, $countOnly = false )
    {
        if ( ( is_string( $queryString ) and $queryString === '' ) or
             ( is_array( $queryString ) and array_key_exists( 'searchQuery', $queryString ) and $queryString['searchQuery'] == '' )
           )
        {
            return null;
        }

        $fieldFilters = $custom = null;
        $objects = array();
        $conds = array();
        $sortClause = $groupByLanguage ? array( 'language_code' => 'asc' ) : null;

        if ( !is_array( $queryString ) )
        {
            $conds['search_query'] = $queryString;
        }
        else
        {
            $conds['search_query'] = @$queryString['fuzzy'] === true ? array( 'like', "%{$queryString['searchQuery']}%" ) : $queryString['searchQuery'];
        }

        if ( $languageCode and $languageCode !== '' )
            $conds['language_code'] = array( array( $languageCode, self::WILDCARD ) );

        if ( $countOnly )
        {
            return parent::count( self::definition(), $conds );
        }
        else
        {
            $rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, false, false, $custom );
            foreach ( $rows as $row )
            {
                if ( ( $obj = eZContentObject::fetch( $row['contentobject_id'] ) ) !== null )
                {
                    if ( $groupByLanguage )
                    {
                        $objects[$row['language_code']][] = $obj;
                    }
                    else
                    {
                        $objects[] = $obj;
                    }
                }
            }
            return $objects;
        }
    }
public static function fetchObjectsForQueryString( $queryString, $groupByLanguage = true, $languageCode = null, $limit = null, $countOnly = false )
    {
        if ( ( is_string( $queryString ) and $queryString === '' ) or
             ( is_array( $queryString ) and array_key_exists( 'searchQuery', $queryString ) and $queryString['searchQuery'] == '' )
           )
        {
            return null;
        }

        $fieldFilters = $custom = null;
        $objects = array();
        $conds = array();
        $sortClause = $groupByLanguage ? array( 'language_code' => 'asc' ) : null;

        if ( !is_array( $queryString ) )
        {
            $conds['search_query'] = $queryString;
        }
        else
        {
            $conds['search_query'] = @$queryString['fuzzy'] === true ? array( 'like', "%{$queryString['searchQuery']}%" ) : $queryString['searchQuery'];
        }

        if ( $languageCode and $languageCode !== '' )
            $conds['language_code'] = array( array( $languageCode, self::WILDCARD ) );

        if ( $countOnly )
        {
            return parent::count( self::definition(), $conds );
        }
        else
        {
            $rows = parent::fetchObjectList( self::definition(), $fieldFilters, $conds, $sortClause, $limit, false, false, $custom );
            foreach ( $rows as $row )
            {
                if ( ( $obj = eZContentObject::fetch( $row['contentobject_id'] ) ) !== null )
                {
                    if ( $groupByLanguage )
                    {
                        $objects[$row['language_code']][] = $obj;
                    }
                    else
                    {
                        $objects[] = $obj;
                    }
                }
            }
            return $objects;
        }
    }
public static function fetchObjectsForQueryString ( $ queryString , $ groupByLanguage = true , $ languageCode = null , $ limit = null , $ countOnly = false ) { if ( ( is_string ( $ queryString ) and $ queryString === '' ) or ( is_array ( $ queryString ) and array_key_exists ( 'searchQuery' , $ queryString ) and $ queryString [ 'searchQuery' ] == '' ) ) { return null ; } $ fieldFilters = $ custom = null ; $ objects = array ( ) ; $ conds = array ( ) ; $ sortClause = $ groupByLanguage ? array ( 'language_code' => 'asc' ) : null ; if ( ! is_array ( $ queryString ) ) { $ conds [ 'search_query' ] = $ queryString ; } else { $ conds [ 'search_query' ] = @ $ queryString [ 'fuzzy' ] === true ? array ( 'like' , "%{$queryString['searchQuery']}%" ) : $ queryString [ 'searchQuery' ] ; } if ( $ languageCode and $ languageCode !== '' ) $ conds [ 'language_code' ] = array ( array ( $ languageCode , self :: WILDCARD ) ) ; if ( $ countOnly ) { return parent :: count ( self :: definition ( ) , $ conds ) ; } else { $ rows = parent :: fetchObjectList ( self :: definition ( ) , $ fieldFilters , $ conds , $ sortClause , $ limit , false , false , $ custom ) ; foreach ( $ rows as $ row ) { if ( ( $ obj = eZContentObject :: fetch ( $ row [ 'contentobject_id' ] ) ) !== null ) { if ( $ groupByLanguage ) { $ objects [ $ row [ 'language_code' ] ] [ ] = $ obj ; } else { $ objects [ ] = $ obj ; } } } return $ objects ; } }
Retrieves the content objects elevated by a given query string, possibly per language.

@param mixed $searchQuery Can be a string containing the search_query to filter on.
Can also be an array looking like the following, supporting fuzzy search optionnally.
<code>
array( 'searchQuery' => ( string )  'foo bar',
'fuzzy'       => ( boolean ) true      )
</code>

@param string $languageCode if filtering on language-code is required
@param array $limit Associative array containing the 'offset' and 'limit' keys, with integers as values, framing the result set. Example :
<code>
array( 'offset' => 0,
'limit'  => 10 )
</code>

@param boolean $countOnly If only the count of matching results is needed
@return mixed An array containing the content objects elevated by the query string, optionnally sorted by language code, null if error. If $countOnly is true,
only the result count is returned.
Retrieves the content objects elevated by a given query string possibly per language .