protected function createGoogleUrl(Query $query) { $searchTerm = $query->getSearchTerm(); $region = $query->getSearchRegion(); $domainZone = $this->config['domainZone']; $googleHost = $this->config['googleHost']; $countryCode = $this->config['countryCode']; if (isset($region['domainZone'])) { $domainZone = $region['domainZone']; } if (isset($region['countryCode'])) { $countryCode = $region['countryCode']; } $googleHost = str_replace('%domainZone%', $domainZone, $googleHost); $url = new GoogleUrl(); $url->setHost($googleHost); if ($this->config['httpOnly']) { $url->setScheme('http'); $url->setParam('gws_rd', 'ssl'); } if (isset($countryCode)) { $url->setParam('cr', 'country' . $countryCode); } $url->setResultsPerPage(100); $url->setSearchTerm($searchTerm); return $url; }