CoolCMS API

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

Properties

Methods

found()

public static found(GeoCoordinates $coordinates[, string $formattedAddress = '' ][, bool $cached = false ]) : self
Parameters
$coordinates : GeoCoordinates
$formattedAddress : string = ''
$cached : bool = false
Return values
self

isCacheable()

Returns whether the answer is worth caching (a point and "not found", not an error).

public isCacheable() : bool
Return values
bool

notFound()

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
On this page

Search results