include/SearchForm/SugarSpot.php

Show: inherited
Table of Contents

\SugarSpot

Package: SugarCRM

Global search

Api
 

Properties

Propertyprotected  $module= '""'
Default value""Details
Type
n/a

Methods

methodpublic__construct( string $current_module = "" ) : void

Parameters
Name Type Description
$current_module string
methodprotected_getCount( \SugarBean $seed, string $main_query ) : void

Get count from query

Parameters
Name Type Description
$seed \SugarBean
$main_query string
methodprotected_performSearch( \$query $query, \$modules $modules, \$offset $offset = -1, \$limit $limit = 20 ) : array

_performSearch

Performs the search from the global search field.

Parameters
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

Returns
Type Description
array
methodprotected_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.

Parameters
Name Type Description
$item1
$key
$patterns
methodprotectedfilterSearchType( 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

Parameters
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

Returns
Type Description
boolean True if the search type fits the query string value; false otherwise
methodprotectedformatSearchResultsToDisplay(  $query,  $modules,  $offset = -1 ) : void

Parameters
Name Type Description
$query
$modules
$offset
methodprotectedgetSearchFields( \$moduleName $moduleName ) : array
static

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)

Parameters
Name Type Description
$moduleName \$moduleName

String name of module to retrieve SearchFields entries for

Returns
Type Description
array of SearchFields
methodprotectedgetSearchModules( ) : array

Determine which modules should be searched against.

Returns
Type Description
array
methodpublicsearch( \$query $query, \$offset $offset = -1,  $limit = 20,  $options = array() ) : array

Perform a search

Parameters
Name Type Description
$query \$query

string what we are searching for

$offset \$offset

int search result offset

$limit
$options
Returns
Type Description
array
methodpublicsearchAndDisplay( \$query $query, \$modules $modules, \$offset $offset = -1 ) : string

searchAndDisplay

Performs the search and returns the HTML widget containing the results

Parameters
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

Returns
Type Description
string HTML code containing results
Details
Deprecated
deprecated since 6.5  
Documentation was generated by DocBlox 0.18.1.