Stevebauman\Location\Drivers\IpInfo::hydrate PHP Метод

hydrate() защищенный Метод

protected hydrate ( Position $position, Illuminate\Support\Fluent $location )
$position Stevebauman\Location\Position
$location Illuminate\Support\Fluent
    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;
    }