Class TimeZoneLocation
Representation of a time zone location.
<?php
use ICanBoogie\TimeZoneLocation;
$zone = new \DateTimeZone('Europe/Paris');
$location = new TimeZoneLocation($zone->getLocation());
echo $location;
echo $location->country_code;
echo $location->latitude;
echo $location->longitude;
$location->latitude = true;
Namespace: ICanBoogie
Located at TimeZoneLocation.php
Methods summary
public static
from( DateTimeZone $zone
)
: ICanBoogie\TimeZoneLocation
Creates an instance from a \DateTimeZone instance.
Creates an instance from a \DateTimeZone instance.
Parameters
Returns
public
__construct( array $location
)
Initializes the $location property.
Initializes the $location property.
Parameters
$location
- Location information provided by \DateTimeZone::getLocation().
public
__get( $property
)
Returns the $country_code, $latitude, $longitude and
$comments properties.
Returns the $country_code, $latitude, $longitude and
$comments properties.
Throws
PropertyNotDefined
in attempt to get an unsupported property.
Inheritdoc
public
__set( $property
, $value
)
Throws
PropertyNotWritable
in attempt to set an unsupported property.
Inheritdoc
public
__toString( void )
: string
Returns the instance formatted as "{$country_code},{$latitude},{$longitude}".
Returns the instance formatted as "{$country_code},{$latitude},{$longitude}".
Returns
string
Properties summary
Magic properties
public read-only
$country_code
: string
The country code of the location.
public read-only
$latitude
: float
The latitude of the location.
public read-only
$longitude
: float
The longitude of the location.