filterByCountryId($country->getId()) ->filterByStateId($state->getId()) ->find(); if (count($countryAreaList) > 0) { return $countryAreaList; } } $countryAreaList = self::create() ->filterByCountryId($country->getId()) ->filterByStateId(null) ->find() ; return $countryAreaList; } }