GeocodingCacheEntry
in package
FinalYes
One row of `cms_system_geocoding_cache`.
ok is valid permanently (an address does not move); not_found only for
NOT_FOUND_RETRY_DAYS days, after which Google may be asked again (the address may
have been added meanwhile).
error is only the sentinel row of the circuit breaker
(GeocodingCacheKey::externalErrorBreaker()) and is valid for
ERROR_RETRY_MINUTES minutes; no address is stored under it.
Table of Contents
Constants
- ERROR_RETRY_MINUTES : int = 2
- How long after an external geocoder failure (quota, network) Google is not called again.
- NOT_FOUND_RETRY_DAYS : int = 30
Properties
- $coordinates : GeoCoordinates|null
- $countryCode : string
- $createdAt : DateTimeImmutable
- $formattedAddress : string
- $hits : int
- $id : int
- $lastUsedAt : DateTimeImmutable|null
- $query : string
- $queryHash : string
- $status : string
Methods
- __construct() : mixed
- fromRow() : self|null
- isReusable() : bool
- Returns whether the cached answer may be used instead of calling Google.
- toLookup() : GeocodingLookup
- toDate() : DateTimeImmutable|null
Constants
ERROR_RETRY_MINUTES
How long after an external geocoder failure (quota, network) Google is not called again.
public
int
ERROR_RETRY_MINUTES
= 2
NOT_FOUND_RETRY_DAYS
public
int
NOT_FOUND_RETRY_DAYS
= 30
Properties
$coordinates read-only
public
GeoCoordinates|null
$coordinates
$countryCode read-only
public
string
$countryCode
$createdAt read-only
public
DateTimeImmutable
$createdAt
$formattedAddress read-only
public
string
$formattedAddress
$hits read-only
public
int
$hits
$id read-only
public
int
$id
$lastUsedAt read-only
public
DateTimeImmutable|null
$lastUsedAt
= null
$query read-only
public
string
$query
$queryHash read-only
public
string
$queryHash
$status read-only
public
string
$status
Methods
__construct()
public
__construct(int $id, string $countryCode, string $queryHash, string $query, string $status, GeoCoordinates|null $coordinates, string $formattedAddress, int $hits, DateTimeImmutable $createdAt[, DateTimeImmutable|null $lastUsedAt = null ]) : mixed
Parameters
- $id : int
- $countryCode : string
- $queryHash : string
- $query : string
- $status : string
- $coordinates : GeoCoordinates|null
- $formattedAddress : string
- $hits : int
- $createdAt : DateTimeImmutable
- $lastUsedAt : DateTimeImmutable|null = null
fromRow()
public
static fromRow(array<string, mixed> $row) : self|null
Parameters
- $row : array<string, mixed>
-
table row (snake_case columns)
Return values
self|nullisReusable()
Returns whether the cached answer may be used instead of calling Google.
public
isReusable(DateTimeImmutable $now) : bool
Parameters
- $now : DateTimeImmutable
Return values
booltoLookup()
public
toLookup() : GeocodingLookup
Return values
GeocodingLookuptoDate()
private
static toDate(mixed $value) : DateTimeImmutable|null
Parameters
- $value : mixed