PHP Class Transport\Entity\Location\Location

Datei anzeigen Open project: opendatach/transport Class Usage Examples

Public Properties

Property Type Description
$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.

Public Methods

Method Description
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.

Method Details

createFromJson() public static method

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
return Location The created instance

createFromXml() public static method

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
return Location The created instance

toXml() abstract public method

Convert to XML representation.
abstract public toXml ( SimpleXMLElement $parent = null ) : SimpleXMLElement
$parent SimpleXMLElement
return SimpleXMLElement

Property Details

$coordinate public_oe property

The location coordinates.
public Coordinate,Transport\Entity $coordinate
return Transport\Entity\Coordinate

$distance public_oe property

If search has been with coordinates, distance to original point in meters.
public float $distance
return float

$name public_oe property

The name of this location.
public string $name
return string

$score public_oe property

The score with regard to the search request, the higher the better.
public int $score
return integer