Ejemplo n.º 1
0
 private function validateLocation(Location $location)
 {
     if ($this->isBlankOrNull($location->getLatitude())) {
         $this->addError(self::LOCATION_LATITUDE_REQUIRED);
     }
     if (!is_numeric($location->getLatitude())) {
         $this->addError(self::LOCATION_LATITUDE_INVALID);
     }
     if ($this->isBlankOrNull($location->getLongitude())) {
         $this->addError(self::LOCATION_LONGITUDE_REQUIRED);
     }
     if (!is_numeric($location->getLongitude())) {
         $this->addError(self::LOCATION_LONGITUDE_INVALID);
     }
     if (!is_numeric($location->getAltitude()) && null !== $location->getAltitude()) {
         $this->addError(self::LOCATION_ALTITUDE_INVALID);
     }
 }