protected function hydrate(Position $position, Fluent $location)
{
$position->countryCode = $location->country;
$position->regionName = $location->region;
$position->cityName = $location->city;
$position->zipCode = $location->postal;
if ($location->loc) {
$coords = explode(',', $location->loc);
if (array_key_exists(0, $coords)) {
$position->latitude = $coords[0];
}
if (array_key_exists(1, $coords)) {
$position->longitude = $coords[1];
}
}
return $position;
}