public function findByCountryAndModule(Country $country, Module $module, State $state = null)
    {
        $response = null;

        $countryInAreaList = CountryAreaQuery::findByCountryAndState($country, $state);

        /** @var CountryArea $countryInArea */
        foreach ($countryInAreaList as $countryInArea) {
            $response = self::create()->filterByAreaId($countryInArea->getAreaId())
                ->filterByModule($module)
                ->findOne()
            ;

            if ($response !== null) {
                break;
            }
        }

        return $response;
    }
public function findByCountryAndModule(Country $country, Module $module, State $state = null)
    {
        $response = null;

        $countryInAreaList = CountryAreaQuery::findByCountryAndState($country, $state);

        /** @var CountryArea $countryInArea */
        foreach ($countryInAreaList as $countryInArea) {
            $response = self::create()->filterByAreaId($countryInArea->getAreaId())
                ->filterByModule($module)
                ->findOne()
            ;

            if ($response !== null) {
                break;
            }
        }

        return $response;
    }
public function findByCountryAndModule ( Country $ country , Module $ module , State $ state = null ) { $ response = null ; $ countryInAreaList = CountryAreaQuery :: findByCountryAndState ( $ country , $ state ) ; /** @var CountryArea $countryInArea */ foreach ( $ countryInAreaList as $ countryInArea ) { $ response = self :: create ( ) -> filterByAreaId ( $ countryInArea -> getAreaId ( ) ) -> filterByModule ( $ module ) -> findOne ( ) ; if ( $ response !== null ) { break ; } } return $ response ; }
Check if a delivery module is suitable for the given country.

@param Country $country
@param Module $module
@param State|null $state

@return null|AreaDeliveryModule
@throws \Propel\Runtime\Exception\PropelException
Check if a delivery module is suitable for the given country .