/** * @param CM_Model_Location $city * @param string $name * @param float $latitude * @param float $longitude * @throws CM_Exception_Invalid * @return CM_Model_Location */ public static function createZip(CM_Model_Location $city, $name, $latitude, $longitude) { if (CM_Model_Location::LEVEL_CITY !== $city->getLevel()) { throw new CM_Exception_Invalid('The parent location should be a city'); } $zip = CM_Model_Location_Zip::create($city->_getLocation(), $name, $latitude, $longitude); return self::fromLocation($zip); }