ICanBoogie
  • Documentation
  • API Reference
  • DateTime v1.0.7
Namespaces
  • ICanBoogie
Classes
  • DateTime
  • TimeZone
  • TimeZoneLocation

Class TimeZoneLocation

Representation of a time zone location.

<?php

use ICanBoogie\TimeZoneLocation;

$zone = new \DateTimeZone('Europe/Paris');
$location = new TimeZoneLocation($zone->getLocation());

echo $location;               // FR,48.86667,2.33333
echo $location->country_code; // FR
echo $location->latitude;     // 48.86667
echo $location->longitude;    // 2.33333

$location->latitude = true;   // throws ICanBoogie\PropertyNotWritable
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

$zone

Returns

ICanBoogie\TimeZoneLocation
public __construct( array $location )

Initializes the $location property.

Initializes the $location property.

Parameters

$location
Location information provided by \DateTimeZone::getLocation().
public __get( string $property )

Returns the $country_code, $latitude, $longitude and $comments properties.

Returns the $country_code, $latitude, $longitude and $comments properties.

Parameters

$property

Throws

PropertyNotDefined
in attempt to get an unsupported property.
public __set( $property, $value )

Throws

PropertyNotWritable
in attempt to set an unsupported property.
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.

public read-only $comments : string

Comments on the location.

DateTime v1.0.7 – Check on GitHub – API documentation generated by ApiGen