public function SmartIpLocation::get in Smart IP 8.4
Same name and namespace in other branches
- 8.2 src/SmartIpLocation.php \Drupal\smart_ip\SmartIpLocation::get()
- 8.3 src/SmartIpLocation.php \Drupal\smart_ip\SmartIpLocation::get()
Gets an item in Smart IP location data or all the Smart IP location data if supplied no parameter.
Parameters
string $key: Name of the item in Smart IP location data.
Return value
mixed Value of the requested item in Smart IP location data or an array of it.
Overrides SmartIpLocationInterface::get
File
- src/
SmartIpLocation.php, line 155 - Contains \Drupal\smart_ip\SmartIpLocation.
Class
- SmartIpLocation
- Implements wrapper and utility methods for Smart IP's data location.
Namespace
Drupal\smart_ipCode
public function get($key = NULL) {
if (!empty($key)) {
$value = $this->{$key};
if (!empty($value)) {
return $value;
}
$this
->getData(FALSE);
if (isset($this->allData[$key])) {
return $this->allData[$key];
}
else {
return NULL;
}
}
return $this
->getData(FALSE);
}