public function getFieldValue(kScope $scope) { kApiCache::addExtraField(kApiCache::ECF_COUNTRY, kApiCache::COND_MATCH, $this->getStringValues($scope)); $ip = $scope->getIp(); $ipGeo = kGeoCoderManager::getGeoCoder($this->getGeoCoderType()); return $ipGeo->getCountry($ip); }
public function getFieldValue(kScope $scope) { kApiCache::addExtraField(kApiCache::ECF_COORDINATES, kApiCache::COND_GEO_DISTANCE, $this->getStringValues($scope)); $ip = $scope->getIp(); $ipGeo = kGeoCoderManager::getGeoCoder($this->getGeoCoderType()); return array($ipGeo->getCoordinates($ip)); // wrap in an array since otherwise the coordinates will be perceived as a list of two values }
protected function getFieldValue(kScope $scope = null) { kApiCache::addExtraField(kApiCache::ECF_COUNTRY); if (!$scope) { $scope = new kScope(); } $ip = $scope->getIp(); $ipGeo = kGeoCoderManager::getGeoCoder($this->getGeoCoderType()); $country = $ipGeo->getCountry($ip); return trim(strtolower($country), " \n\r\t"); }
protected function getFieldValue(kScope $scope = null) { kApiCache::addExtraField(kApiCache::ECF_COORDINATES); if (!$scope) { $scope = new kScope(); } $ip = $scope->getIp(); $ipGeo = kGeoCoderManager::getGeoCoder($this->getGeoCoderType()); $coordinates = $ipGeo->getCoordinates($ip); return implode(",", $coordinates); }