common/models/entities/Region.php
public static function findUnique( $name, $countryId, $provinceId ) {

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

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

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