GeocodingLookup
in package
FinalYes
Result of a query to the external geocoder or to `cms_system_geocoding_cache`.
Three states, because they are handled differently:
ok: a point exists; it is cached,not_found: Google does not know the address; it is cached (a typo does not hit Google on every save),error: network, quota or missing key; it is not cached (the next call tries again).
Table of Contents
Constants
- STATUS_ERROR : string = 'error'
- STATUS_NOT_FOUND : string = 'not_found'
- STATUS_OK : string = 'ok'
Properties
- $cached : bool
- $coordinates : GeoCoordinates|null
- $formattedAddress : string
- $status : string
Methods
- error() : self
- found() : self
- isCacheable() : bool
- Returns whether the answer is worth caching (a point and "not found", not an error).
- isFound() : bool
- notFound() : self
- __construct() : mixed
Constants
STATUS_ERROR
public
string
STATUS_ERROR
= 'error'
STATUS_NOT_FOUND
public
string
STATUS_NOT_FOUND
= 'not_found'
STATUS_OK
public
string
STATUS_OK
= 'ok'
Properties
$cached read-only
public
bool
$cached
= false
$coordinates read-only
public
GeoCoordinates|null
$coordinates
= null
$formattedAddress read-only
public
string
$formattedAddress
= ''
$status read-only
public
string
$status
Methods
error()
public
static error() : self
Return values
selffound()
public
static found(GeoCoordinates $coordinates[, string $formattedAddress = '' ][, bool $cached = false ]) : self
Parameters
- $coordinates : GeoCoordinates
- $formattedAddress : string = ''
- $cached : bool = false
Return values
selfisCacheable()
Returns whether the answer is worth caching (a point and "not found", not an error).
public
isCacheable() : bool
Return values
boolisFound()
public
isFound() : bool
Return values
boolnotFound()
public
static notFound([bool $cached = false ]) : self
Parameters
- $cached : bool = false
Return values
self__construct()
private
__construct(string $status[, GeoCoordinates|null $coordinates = null ][, string $formattedAddress = '' ][, bool $cached = false ]) : mixed
Parameters
- $status : string
- $coordinates : GeoCoordinates|null = null
- $formattedAddress : string = ''
- $cached : bool = false