Пример #1
0
 /**
  * This function is the global search
  * @param $api ServiceBase The API class of the request
  * @param $args array The arguments array passed in from the API
  * @return array result set
  */
 public function globalSearch(ServiceBase $api, array $args)
 {
     $api->action = 'list';
     // This is required to keep the loadFromRow() function in the bean from making our day harder than it already is.
     $GLOBALS['disable_date_format'] = true;
     $search = new UnifiedSearchApi();
     $options = $search->parseSearchOptions($api, $args);
     $options['custom_where'] = $this->getCustomWhereForModule($args['module_list']);
     $searchEngine = new SugarSpot();
     $options['resortResults'] = true;
     $recordSet = $search->globalSearchSpot($api, $args, $searchEngine, $options);
     return $recordSet;
 }