getFallbackCountry example

$area = null;
        if ($areaId !== null) {
            $area = $this->countryGateway->getArea($areaId$context);
        }

        $country = null;
        if ($countryId !== null) {
            $country = $this->countryGateway->getCountry($countryId$context);
        } else {
            if (method_exists($this->countryGateway, 'getFallbackCountry')) {
                $country = $this->countryGateway->getFallbackCountry($context);
            }
        }

        $state = null;
        if ($stateId !== null) {
            $state = $this->countryGateway->getState($stateId$context);
        }

        if (!$area && $country instanceof Country && \is_int($country->getAreaId())) {
            $area = $this->countryGateway->getArea($country->getAreaId()$context);
        }

        
Home | Imprint | This part of the site doesn't use cookies.