PHP Класс Transport\Entity\Location\Location

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$coordinate Transport\Entity\Coordinate The location coordinates.
$distance float If search has been with coordinates, distance to original point in meters.
$name string The name of this location.
$score integer The score with regard to the search request, the higher the better.

Открытые методы

Метод Описание
createFromJson ( object $json, Location $obj = null ) : Location Factory method to create an instance and extract the data from the given JSON object.
createFromXml ( SimpleXMLElement $xml, Location $obj = null ) : Location Factory method to create an instance and extract the data from the given xml.
toXml ( SimpleXMLElement $parent = null ) : SimpleXMLElement Convert to XML representation.

Описание методов

createFromJson() публичный статический Метод

Factory method to create an instance and extract the data from the given JSON object.
public static createFromJson ( object $json, Location $obj = null ) : Location
$json object The item JSON
$obj Location An object or null to create it
Результат Location The created instance

createFromXml() публичный статический Метод

Factory method to create an instance and extract the data from the given xml.
public static createFromXml ( SimpleXMLElement $xml, Location $obj = null ) : Location
$xml SimpleXMLElement The item xml
$obj Location An object or null to create it
Результат Location The created instance

toXml() абстрактный публичный Метод

Convert to XML representation.
abstract public toXml ( SimpleXMLElement $parent = null ) : SimpleXMLElement
$parent SimpleXMLElement
Результат SimpleXMLElement

Описание свойств

$coordinate публичное свойство

The location coordinates.
public Coordinate,Transport\Entity $coordinate
Результат Transport\Entity\Coordinate

$distance публичное свойство

If search has been with coordinates, distance to original point in meters.
public float $distance
Результат float

$name публичное свойство

The name of this location.
public string $name
Результат string

$score публичное свойство

The score with regard to the search request, the higher the better.
public int $score
Результат integer