modules/Home/QuickSearch.php
Package: SugarCRMquicksearchQuery 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
CONDITION_LIKE_CUSTOM
= 'like_custom'
CONDITION_EQUAL
= 'equal'
Properties
Methods
constructWhere(
Object $focus, array $args
)
:
string
Internal function to construct where clauses
Parameters
Name |
Type |
Description |
$focus |
Object |
|
$args |
array |
|
Returns
externalApi(
array $args
)
:
array
Returns search results from external API
Parameters
Name |
Type |
Description |
$args |
array |
|
Returns
filterResults(
array $list
)
:
array
Filter duplicate results from the list
Parameters
Name |
Type |
Description |
$list |
array |
|
Returns
getFilteredJsonResults(
array $results
)
:
string
Returns filtered JSON encoded search results
Parameters
Name |
Type |
Description |
$results |
array |
|
Returns
getFormattedJsonResults(
array $results, array $args
)
:
string
Returns formatted JSON encoded search results
Parameters
Name |
Type |
Description |
$results |
array |
|
$args |
array |
|
Returns
getJsonEncodedData(
array $data
)
:
string
Returns JSON encoded data
Parameters
Name |
Type |
Description |
$data |
array |
|
Returns
getNonPrivateTeamsWhere(
array $args
)
:
string
Returns additional where condition for non private teams
Parameters
Name |
Type |
Description |
$args |
array |
|
Returns
getRawResults(
array $args, boolean $singleSelect
=
false
)
:
array
Returns raw search results. Filters should be applied later.
Parameters
Name |
Type |
Description |
$args |
array |
|
$singleSelect |
boolean |
|
Returns
getUserResults(
string $condition
)
:
array
Returns user search results
Parameters
Name |
Type |
Description |
$condition |
string |
|
Returns
get_non_private_teams_array(
array $args
)
:
array
Returns non private teams as search results
Parameters
Name |
Type |
Description |
$args |
array |
|
Returns
get_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 |
overrideContactId(
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
prepareArguments(
$args
)
:
array
Returns prepared arguments. Should be redefined in child classes.
Parameters
Name |
Type |
Description |
$args |
|
|
Returns
prepareField(
array $field, array $args
)
:
array
Returns prepared field array. Should be redefined in child classes.
Parameters
Name |
Type |
Description |
$field |
array |
|
$args |
array |
|
Returns
prepareResults(
array $data, array $args
)
:
array
Returns search results with all fixes applied
Parameters
Name |
Type |
Description |
$data |
array |
|
$args |
array |
|
Returns
query(
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 |
updateContactArrayArguments(
array $args
)
:
array
Returns updated arguments array for contact query
Parameters
Name |
Type |
Description |
$args |
array |
|
Returns
updateContactName(
array $result, array $args
)
:
string
Updates search result with proper contact name
Parameters
Name |
Type |
Description |
$result |
array |
|
$args |
array |
|
Returns
updateData(
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
updateQueryArguments(
array $args
)
:
array
Returns updated arguments array
Parameters
Name |
Type |
Description |
$args |
array |
|
Returns
updateTeamArrayArguments(
array $args
)
:
array
Returns updated arguments array for team query
Parameters
Name |
Type |
Description |
$args |
array |
|
Returns