private static function wordSearch($word, $start, $end, $category) { $cachename = 'calsearch_' . $word . '_' . str_replace('/', '', $start) . '_' . str_replace('/', '', $end); if ($category) { $cachename .= '_' . $category->catid; } if ($results = self::read_temp_cache($cachename)) { return $results; } $criteria = array( new SearchCriterion('start', $start), new SearchCriterion('end', $end), new SearchCriterion('fulltext', $word) ); if($category) { $criteria[] = new SearchCriterion('catid', $category->catid); } $results = self::$php_client->findEventsHeaders(SearchCriterion::forSOAP($criteria)); self::write_temp_cache($cachename, $results); return $results; }
public static function fullTextSearch($text, $start, $end, $category = NULL) { $criteria = array(new SearchCriterion('start', $start), new SearchCriterion('end', $end), new SearchCriterion('fulltext')); foreach (explode(' ', $text) as $word) { if ($word) { $criteria[2]->addValue($word); } } if ($category) { $criteria[] = new SearchCriterion('catid', $category->catid); } return self::$php_client->findEventsHeaders(SearchCriterion::forSOAP($criteria)); }