Skip to content

Resources: Locations

Danny Li edited this page Feb 4, 2018 · 2 revisions

Special methods

The Locations resource does not have any special methods.

Location object

The Location object has the following methods:

<?php
use Exploriment\HetznerCloud;

// retrieve the location
$location = HetznerCloud\Locations::find(1);

// returns the location ID (int)
$location->getId();

// returns the location name (string)
$location->getName();

// returns the location description (string)
$location->getDescription();

// returns the location country (string)
$location->getCountry();

// returns the city closest to the location (string)
$location->getCity();

// returns the latitude of the city closest to the location (float)
$location->getLatitude();

// returns the longitude of the city closest to the location (float)
$location->getLongitude();
Clone this wiki locally