public function updateFromGeoIp(User $user, array $ipInfo)
    {
        $contact = $user->getContact();
        $country = $contact->getCountry();
        $city = $contact->getCity();
        $region = $contact->getRegion();

        if (!$country) {
            $contact->setCountry($ipInfo['country']);
        }

        if (!$city) {
            $contact->setCountry($ipInfo['country']);
        }

        if (!$region) {
            $contact->setCountry($ipInfo['country']);
        }

        $this->dm->persist($user);

        return $this;
    }
public function updateFromGeoIp(User $user, array $ipInfo)
    {
        $contact = $user->getContact();
        $country = $contact->getCountry();
        $city = $contact->getCity();
        $region = $contact->getRegion();

        if (!$country) {
            $contact->setCountry($ipInfo['country']);
        }

        if (!$city) {
            $contact->setCountry($ipInfo['country']);
        }

        if (!$region) {
            $contact->setCountry($ipInfo['country']);
        }

        $this->dm->persist($user);

        return $this;
    }
public function updateFromGeoIp ( User $ user , array $ ipInfo ) { $ contact = $ user -> getContact ( ) ; $ country = $ contact -> getCountry ( ) ; $ city = $ contact -> getCity ( ) ; $ region = $ contact -> getRegion ( ) ; if ( ! $ country ) { $ contact -> setCountry ( $ ipInfo [ 'country' ] ) ; } if ( ! $ city ) { $ contact -> setCountry ( $ ipInfo [ 'country' ] ) ; } if ( ! $ region ) { $ contact -> setCountry ( $ ipInfo [ 'country' ] ) ; } $ this -> dm -> persist ( $ user ) ; return $ this ; }
Update User contact data from geoIp

@param User  $user
@param array $ipInfo

@return self
Update User contact data from geoIp