Sulu\Bundle\LocationBundle\Geolocator\GeolocatorLocation::toArray PHP Method

toArray() public method

Serialize the location to an array.
public toArray ( ) : array
return array
    public function toArray()
    {
        $res = [];
        foreach (['id', 'displayTitle', 'street', 'number', 'code', 'town', 'country', 'longitude', 'latitude'] as $propertyName) {
            $res[$propertyName] = $this->{'get' . ucfirst($propertyName)}();
        }
        $res['name'] = TextUtils::truncate($this->getDisplayTitle(), 75);
        return $res;
    }