common/models/entities/City.php
public static function findUniqueByZone( $name, $countryId, $provinceId, $zone ) {

		return self::find()->where( 'name=:name AND countryId=:cid AND provinceId=:pid AND zone=:zone', [ ':name' => $name, ':cid' => $countryId, ':pid' => $provinceId, ':zone' => $zone ] )->one();
	}
public static function findUniqueByZone( $name, $countryId, $provinceId, $zone ) {

		return self::find()->where( 'name=:name AND countryId=:cid AND provinceId=:pid AND zone=:zone', [ ':name' => $name, ':cid' => $countryId, ':pid' => $provinceId, ':zone' => $zone ] )->one();
	}
public static function findUniqueByZone ( $ name , $ countryId , $ provinceId , $ zone ) { return self :: find ( ) -> where ( 'name=:name AND countryId=:cid AND provinceId=:pid AND zone=:zone' , [ ':name' => $ name , ':cid' => $ countryId , ':pid' => $ provinceId , ':zone' => $ zone ] ) -> one ( ) ; }
Try to find out a city having unique name within zone.

@param string $name
@param integer $countryId
@param integer $provinceId
@param string $zone
@return City by name, country id, province id and zone
Try to find out a city having unique name within zone .