tp TouchPointWP Location - TenthPres/TouchPoint-WP GitHub Wiki

tp\TouchPointWP\Location

A Location is generally a physical place, with an internet connection. These likely correspond to campuses, but don't necessarily need to.


Properties

name

public string $name

lat

public ?float $lat

lng

public ?float $lng

radius

public float $radius

ipAddresses

public array $ipAddresses

Methods

getLocations

Get an array of the

public static getLocations(): \tp\TouchPointWP\Location[]
  • This method is static.

getLocationForIP

public static getLocationForIP(?string $ipAddress = null): ?\tp\TouchPointWP\Location
  • This method is static. Parameters:
Parameter Type Description
$ipAddress ?string

hasGeo

Indicates whether this particular location has lat/lng location.

public hasGeo(): bool

asGeoIFace

Returns a standardized stdObject, or null if not viable.

public asGeoIFace(string $type = "unknown"): object|null

Return object properties are lat, lng, human, and type.

Parameters:

Parameter Type Description
$type string 'loc' for navigator location, or 'ip' for ip address location

getLocationForLatLng

Get a location that corresponds to a given lat/lng, or null if none match.

public static getLocationForLatLng(float $lat, float $lng): \tp\TouchPointWP\Location|null
  • This method is static. Parameters:
Parameter Type Description
$lat float
$lng float

validateSetting

Validates and corrects the Locations settings value.

public static validateSetting(string $settings): false|string
  • This method is static. Parameters:
Parameter Type Description
$settings string

locationName

Get the name of the location.

public locationName(): ?string