Beispiel #1
0
 public static function getPlaceResults($cache, $conn, $title)
 {
     // clean title
     $title = AutoCompleter::placeAbbrevsCleanAbbrev($title);
     // trim title to 100
     $title = mb_substr($title, 0, 100);
     // lookup in cache
     $cacheKey = AutoCompleter::generatePlaceCacheKey($title);
     $results = AutoCompleter::lookupCache($cache, $cacheKey);
     if ($results === false) {
         // lookup in db
         $results = AutoCompleter::lookupPlaceDB($conn, $title);
         // cache results
         AutoCompleter::cacheResults($cache, $cacheKey, $results, AutoCompleter::EXP_TIME);
     }
     return $results;
 }