include/SearchForm/SugarSpot.php
\SugarSpot
Global search
- Api
Properties
Methods
__construct(
string $current_module
=
""
)
:
void
Name | Type | Description |
---|---|---|
$current_module | string |
_getCount(
\SugarBean $seed, string $main_query
)
:
void
Get count from query
Name | Type | Description |
---|---|---|
$seed | \SugarBean | |
$main_query | string |
_performSearch(
\$query $query, \$modules $modules, \$offset $offset
=
-1, \$limit $limit
=
20
)
:
array
_performSearch
Performs the search from the global search field.
Name | Type | Description |
---|---|---|
$query | \$query | string what we are searching for |
$modules | \$modules | array modules we are searching in |
$offset | \$offset | int search result offset |
$limit | \$limit | int search limit |
Type | Description |
---|---|
array |
_searchKeys(
$item1, $key, $patterns
)
:
void
Function used to walk the array and find keys that map the queried string.
if both the pattern and module name is found the promote the string to thet top.
Name | Type | Description |
---|---|---|
$item1 | ||
$key | ||
$patterns |
filterSearchType(
String $type, String $query
)
:
boolean
filterSearchType
This is a private function to determine if the search type field should be filtered out based on the query string value
Name | Type | Description |
---|---|---|
$type | String | The string value of the field type (e.g. phone, date, datetime, int, etc.) |
$query | String | The search string value sent from the global search |
Type | Description |
---|---|
boolean | True if the search type fits the query string value; false otherwise |
formatSearchResultsToDisplay(
$query, $modules, $offset
=
-1
)
:
void
Name | Type | Description |
---|---|---|
$query | ||
$modules | ||
$offset |
getSearchFields(
\$moduleName $moduleName
)
:
array
Returns the array containing the $searchFields for a module. This function first checks the default installation directories for the SearchFields.php file and then loads any custom definition (if found)
Name | Type | Description |
---|---|---|
$moduleName | \$moduleName | String name of module to retrieve SearchFields entries for |
Type | Description |
---|---|
array | of SearchFields |
getSearchModules(
)
:
array
Determine which modules should be searched against.
Type | Description |
---|---|
array |
search(
\$query $query, \$offset $offset
=
-1, $limit
=
20, $options
=
array()
)
:
array
Perform a search
Name | Type | Description |
---|---|---|
$query | \$query | string what we are searching for |
$offset | \$offset | int search result offset |
$limit | ||
$options |
Type | Description |
---|---|
array |
searchAndDisplay(
\$query $query, \$modules $modules, \$offset $offset
=
-1
)
:
string
searchAndDisplay
Performs the search and returns the HTML widget containing the results
Name | Type | Description |
---|---|---|
$query | \$query | string what we are searching for |
$modules | \$modules | array modules we are searching in |
$offset | \$offset | int search result offset |
Type | Description |
---|---|
string | HTML code containing results |
- Deprecated
- deprecated since 6.5