示例#1
0
 /**
  * @param Alert $alert
  *
  * @return AlertDTO
  */
 public function updateAlert(Alert $alert)
 {
     $infos = Geocoder::getLocation($alert->getPositionLat(), $alert->getPositionLong());
     $city = Geocoder::getCityFromAddress($infos);
     $department = Geocoder::getDepartmentFromAddress($infos);
     $country = Geocoder::getCountryFromAddress($infos);
     $alert->setPositionCity($city);
     $alert->setPositionDep($department);
     $alert->setPositionCountry($country);
     $this->em->persist($alert);
     $this->em->flush();
     return new AlertDTO($alert);
 }
示例#2
0
 /**
  * @param User $user
  *
  * @return UserDTO
  */
 public function updateUser(User $user)
 {
     $infos = Geocoder::getLocation($user->getPositionLat(), $user->getPositionLong());
     $city = Geocoder::getCityFromAddress($infos);
     $department = Geocoder::getDepartmentFromAddress($infos);
     $country = Geocoder::getCountryFromAddress($infos);
     $user->setPositionCity($city);
     $user->setPositionDep($department);
     $user->setPositionCountry($country);
     $this->em->persist($user);
     $this->em->flush();
     return new UserDTO($user);
 }