modules/Home/QuickSearch.php

Show: inherited
Table of Contents

\quicksearchQuery

Package: SugarCRM

quicksearchQuery class, handles AJAX calls from quicksearch.js

Copyright
2004-2007 SugarCRM Inc.  
License
SugarCRM Professional End User License  
Since
Class available since Release 4.5.1  

Constants

Constantstring  CONDITION_CONTAINS = 'contains'

Condition operators

string
Constant  CONDITION_LIKE_CUSTOM = 'like_custom'
Constant  CONDITION_EQUAL = 'equal'

Properties

Propertyprotected  $extra_where= ''
Details
Type
n/a

Methods

methodprotectedconstructWhere( Object $focus, array $args ) : string

Internal function to construct where clauses

Parameters
Name Type Description
$focus Object
$args array
Returns
Type Description
string
methodpublicexternalApi( array $args ) : array

Returns search results from external API

Parameters
Name Type Description
$args array
Returns
Type Description
array
methodprotectedfilterResults( array $list ) : array

Filter duplicate results from the list

Parameters
Name Type Description
$list array
Returns
Type Description
array
methodprotectedformatResults( array $results, array $args ) : array

Returns formatted data

Parameters
Name Type Description
$results array
$args array
Returns
Type Description
array
methodpublicfts_query( ) : void

methodprotectedgetFilteredJsonResults( array $results ) : string

Returns filtered JSON encoded search results

Parameters
Name Type Description
$results array
Returns
Type Description
string
methodprotectedgetFormattedJsonResults( array $results, array $args ) : string

Returns formatted JSON encoded search results

Parameters
Name Type Description
$results array
$args array
Returns
Type Description
string
methodprotectedgetJsonEncodedData( array $data ) : string

Returns JSON encoded data

Parameters
Name Type Description
$data array
Returns
Type Description
string
methodprotectedgetNonPrivateTeamsWhere( array $args ) : string

Returns additional where condition for non private teams

Parameters
Name Type Description
$args array
Returns
Type Description
string
methodprotectedgetRawResults( array $args, boolean $singleSelect = false ) : array

Returns raw search results. Filters should be applied later.

Parameters
Name Type Description
$args array
$singleSelect boolean
Returns
Type Description
array
methodprotectedgetUserArray( string $condition ) : array

Returns user array

Parameters
Name Type Description
$condition string
Returns
Type Description
array
methodprotectedgetUserResults( string $condition ) : array

Returns user search results

Parameters
Name Type Description
$condition string
Returns
Type Description
array
methodpublicget_contact_array(  $args ) : void

get_contact_array

Parameters
Name Type Description
$args
methodpublicget_non_private_teams_array( array $args ) : array

Returns non private teams as search results

Parameters
Name Type Description
$args array
Returns
Type Description
array
methodpublicget_user_array( array $args ) : array

Returns the list of users, faster than using query method for Users module

Parameters
Name Type Description
$args array

arguments used to construct query, see query() for example

Returns
Type Description
array list of users returned
methodprotectedoverrideContactId( array $result, object $data, array $args ) : array

Overrides contact_id and reports_to_id params (to 'id')

Parameters
Name Type Description
$result array
$data object
$args array
Returns
Type Description
array
methodprotectedprepareArguments(  $args ) : array

Returns prepared arguments. Should be redefined in child classes.

Parameters
Name Type Description
$args
Returns
Type Description
array
methodprotectedprepareField( array $field, array $args ) : array

Returns prepared field array. Should be redefined in child classes.

Parameters
Name Type Description
$field array
$args array
Returns
Type Description
array
methodprotectedprepareResults( array $data, array $args ) : array

Returns search results with all fixes applied

Parameters
Name Type Description
$data array
$args array
Returns
Type Description
array
methodpublicquery( array $args ) : array

Query a module for a list of items

Parameters
Name Type Description
$args array

example for querying Account module with 'a': array ('modules' => array('Accounts'), // module to use 'field_list' => array('name', 'id'), // fields to select 'group' => 'or', // how the conditions should be combined 'conditions' => array(array( // array of where conditions to use 'name' => 'name', // field 'op' => 'like_custom', // operation 'end' => '%', // end of the query 'value' => 'a', // query value ) ), 'order' => 'name', // order by 'limit' => '30', // limit, number of records to return )

Returns
Type Description
array list of elements returned
methodprotectedupdateContactArrayArguments( array $args ) : array

Returns updated arguments array for contact query

Parameters
Name Type Description
$args array
Returns
Type Description
array
methodprotectedupdateContactName( array $result, array $args ) : string

Updates search result with proper contact name

Parameters
Name Type Description
$result array
$args array
Returns
Type Description
string
methodprotectedupdateData( array $data, \SugarBean $focus, string $orderBy, string $where, string $limit, boolean $singleSelect = false ) : array

Merges current module search results to given list and returns it

Parameters
Name Type Description
$data array
$focus \SugarBean
$orderBy string
$where string
$limit string
$singleSelect boolean
Returns
Type Description
array
methodprotectedupdateQueryArguments( array $args ) : array

Returns updated arguments array

Parameters
Name Type Description
$args array
Returns
Type Description
array
methodprotectedupdateTeamArrayArguments( array $args ) : array

Returns updated arguments array for team query

Parameters
Name Type Description
$args array
Returns
Type Description
array
Documentation was generated by DocBlox 0.18.1.