public function getNames()
    {
        $cacheId   = 'SearchEngine.getSearchEngineNames';
        $cache     = Cache::getTransientCache();
        $nameToUrl = $cache->fetch($cacheId);

        if (empty($nameToUrl)) {
            $searchEngines = $this->getDefinitions();

            $nameToUrl = array();
            foreach ($searchEngines as $url => $info) {
                if (!isset($nameToUrl[$info['name']])) {
                    $nameToUrl[$info['name']] = $url;
                }
            }
            $cache->save($cacheId, $nameToUrl);
        }

        return $nameToUrl;
    }
public function getNames()
    {
        $cacheId   = 'SearchEngine.getSearchEngineNames';
        $cache     = Cache::getTransientCache();
        $nameToUrl = $cache->fetch($cacheId);

        if (empty($nameToUrl)) {
            $searchEngines = $this->getDefinitions();

            $nameToUrl = array();
            foreach ($searchEngines as $url => $info) {
                if (!isset($nameToUrl[$info['name']])) {
                    $nameToUrl[$info['name']] = $url;
                }
            }
            $cache->save($cacheId, $nameToUrl);
        }

        return $nameToUrl;
    }
public function getNames ( ) { $ cacheId = 'SearchEngine.getSearchEngineNames' ; $ cache = Cache :: getTransientCache ( ) ; $ nameToUrl = $ cache -> fetch ( $ cacheId ) ; if ( empty ( $ nameToUrl ) ) { $ searchEngines = $ this -> getDefinitions ( ) ; $ nameToUrl = array ( ) ; foreach ( $ searchEngines as $ url => $ info ) { if ( ! isset ( $ nameToUrl [ $ info [ 'name' ] ] ) ) { $ nameToUrl [ $ info [ 'name' ] ] = $ url ; } } $ cache -> save ( $ cacheId , $ nameToUrl ) ; } return $ nameToUrl ; }
Returns list of search engines by name

@return array  Array of ( searchEngineName => URL )
Returns list of search engines by name