Tiger_Location_Adapter_Abstract
@api· implementsTiger_Location_Adapter_Interface
Tiger_Location_Adapter_Abstract — base for Location adapters.
Every operation defaults to "unsupported" (throws), so a concrete adapter overrides ONLY
the ones it provides and lists them in capabilities(). Also carries the adapter's config
(from tiger.location.adapters.
Methods
__construct()
__construct(array $config = [])
Store the adapter's config (from tiger.location.adapters.
$configarray— the adapter's config map
capabilities()
capabilities(): array
The CAP_* operations this adapter supports (none by default).
Returns array — a list of CAP_* capability constants
supports()
supports(string $capability): bool
Does this adapter support a CAP_* operation?
$capabilitystring— the CAP_* capability to check
Returns bool — true if the operation is supported
suggest()
suggest(string $query, array $opts = []): array
Suggest address matches (unsupported here — override in a capable adapter).
$querystring— the partial address text$optsarray— provider options
Returns array — the suggestions
Throws Tiger_Location_Exception — always, unless the adapter overrides this
geocode()
geocode(string $query, array $opts = []): array
Geocode free text (unsupported here — override in a capable adapter).
$querystring— the address text to geocode$optsarray— provider options
Returns array — the matches
Throws Tiger_Location_Exception — always, unless the adapter overrides this
reverse()
reverse(float $lat, float $lng, array $opts = []): ?Tiger_Location_Place
Reverse-geocode a coordinate (unsupported here — override in a capable adapter).
$latfloat— the latitude$lngfloat— the longitude$optsarray— provider options
Returns ?Tiger_Location_Place — the nearest place
Throws Tiger_Location_Exception — always, unless the adapter overrides this
ip()
ip(string $ip, array $opts = []): ?Tiger_Location_Place
Geolocate an IP (unsupported here — override in a capable adapter).
$ipstring— the IP address to look up$optsarray— provider options
Returns ?Tiger_Location_Place — the place
Throws Tiger_Location_Exception — always, unless the adapter overrides this