public function Database::getFields in Smart IP 6.2
Same name and namespace in other branches
- 7.2 includes/vendor/ip2location/ip2location-php/IP2Location.php \IP2Location\Database::getFields()
Return this database's available fields
@access public
Parameters
boolean $asNames Whether to return the mapped names intead of numbered constants:
Return value
array
File
- includes/
vendor/ ip2location/ ip2location-php/ IP2Location.php, line 1566
Class
- Database
- IP2Location database class
Namespace
IP2LocationCode
public function getFields($asNames = false) {
$result = array_keys(array_filter(self::$columns, function ($field) {
return 0 !== $field[$this->type];
}));
if ($asNames) {
$return = [];
foreach ($result as $field) {
$return[] = self::$names[$field];
}
return $return;
}
else {
return $result;
}
}