. * */ /** * provides an interface to all search providers */ class OC_SEARCH{ static private $providers=array(); /** * register a new search provider to be used * @param OC_Search_Provider $provider */ public static function registerProvider($provider){ self::$providers[]=$provider; } /** * search all provider for $query * @param string query * @return array An array of OC_Search_Result's */ public static function search($query){ $results=array(); foreach(self::$providers as $provider){ $results=array_merge($results,$provider->search($query)); } return $results; } }