@param Country|null $country

@return Search
553146
public function setCountry(Country $country = null)
    {
        if ($this->country !== $country) {
            $this->country = $country;
        }

        return $this;
    }
1309497
private Locale searchLocale(String language, String country,
                                String variant) {
        for (Locale loc : Locale.getAvailableLocales()) {
            if (loc.getLanguage().equals(language) &&
                (country == null || loc.getCountry().equals(country)) &&
                (variant == null || loc.getVariant().equals(variant))) {
                return loc;
            }
        }
        return null;
    }
1177165
public function setCountry($country)
    {
        if (!empty($country) && is_string($country) && ctype_print($country)) {
            $this->country = trim($country);
        }

        return $this;
    }
122282
public function filterByCountry($country) {
        foreach ($this->_paymentMethod as $name => $class) {
            if (!in_array(strtoupper($country), $class->getSupportedCountries()) && !in_array('00', $class->getSupportedCountries()))
                unset($this->paymentMethods[$name]);
        }
        return $this;
    }
1336171
public static function countryContinentCode($countryCode)
    {
        foreach (static::CODES as $code => $countryCodes) {
            if (in_array($countryCode, $countryCodes)) {
                return $code;
            }
        }

        return null;
    }
1013128
public function addCountry(Search $entity)
    {
        if ($entity->getCountry() instanceof Country) {
            $this->add(function (QueryBuilder $query) use ($entity) {
                $query
                    ->andWhere('i.country = :country')
                    ->setParameter('country', $entity->getCountry()->getId());
            });
        }

        return $this;
    }
323327
public static function getContinent($country)
    {
        /** @var RegionDataProvider $dataProvider */
        $dataProvider = StaticContainer::get('Piwik\Intl\Data\Provider\RegionDataProvider');

        $countryList = $dataProvider->getCountryList();

        if ($country == 'ti') {
            $country = 'cn';
        }

        return isset($countryList[$country]) ? $countryList[$country] : 'unk';
    }
585401
public function getLanguageForCountry($country = null)
    {
        if ($country === null) {
            $country = $this->_country;
        }
        // Since getLanguage defaults to EN, check so we actually have a match
        $language = KlarnaCountry::getLanguage($country);
        if (KlarnaCountry::checkLanguage($country, $language)) {
            return $language;
        }
        return false;
    }
283050
public function statistics($country = null, $appID = null)
    {
        return $this->client->executeRequest(
            new StatisticsRequest($country, $appID)
        );
    }
981519
public function country($country_id, Request $request = null)
    {
        $country = Country::with('zone')->find($country_id);

        if ($request) {
            $included = [];
            $query = $country->getInlcudeResources($request->include);
            if ($query) {
                $collection = new Collection(
                    $query,
                    str_singular($request->include)
                );
                $included = $collection->toArray();
            }
            $links = $request ? ['self' => $request->url()] : [];
            return $this->respondWithItem(
                $country,
                'country',
                $links,
                $included
            );
        }
        return $country;
    }
403805
public function setCountry(Country $country = null)
    {
        if ($this->country !== $country) {
            // romove link on this item for old country
            if ($this->country instanceof Country) {
                $tmp = $this->country;
                $this->country = null;
                $tmp->removeItem($this);
            }
            $this->country = $country;
            // add link on this item
            if ($this->country instanceof Country) {
                $this->country->addItem($this);
            }
        }

        return $this;
    }
413098
protected function getCheapestDelivery(Address $address = null, Country $country = null)
    {
        $cart = $this->getCurrentRequest()->getSession()->getSessionCart();

        $deliveryModules = ModuleQuery::create()
            ->filterByActivate(1)
            ->filterByType(BaseModule::DELIVERY_MODULE_TYPE, Criteria::EQUAL)
            ->find()
        ;

        $virtual = $cart->isVirtual();

        /** @var \Thelia\Model\Module $deliveryModule */
        foreach ($deliveryModules as $deliveryModule) {
          $areaDeliveryModule = AreaDeliveryModuleQuery::create()
              ->findByCountryAndModule($country, $deliveryModule, $state);
          if (null === $areaDeliveryModule && false === $virtual) {
              continue;
          }

          $moduleInstance = $deliveryModule->getDeliveryModuleInstance($this->container);

          if (true === $virtual
            && false === $moduleInstance->handleVirtualProductDelivery()
            ) {
            continue;
          }

            try {
                $deliveryPostageEvent = new DeliveryPostageEvent($moduleInstance, $cart, $address, $country, $state);
                $this->dispatcher->dispatch(
                    TheliaEvents::MODULE_DELIVERY_GET_POSTAGE,
                    $deliveryPostageEvent
                );

                if ($deliveryPostageEvent->isValidModule()) {
                    $postage = $deliveryPostageEvent->getPostage();

                    if (null === $this->postage || $this->postage > $postage->getAmount()) {
                        $this->postage = $postage->getAmount();
                        $this->postageTax = $postage->getAmountTax();
                        $this->postageTaxRuleTitle = $postage->getTaxRuleTitle();
                        $this->deliveryId = $deliveryModule->getId();
                    }
                }
            } catch (DeliveryException $ex) {
                // Module is not available
            }
        }
    }
804493
public function setCountry(\Chill\MainBundle\Entity\Country $country = null)
    {
        $this->country = $country;

        return $this;
    }
488637
public function addCountry($country)
    {
        if (!in_array($country, $this->countries)) {
            $this->countries[] = $country;
        }

        return $this;
    }
960604
public function getSchedule($country = null, $date = null){
		if($country != null && $date != null) {
			$url = self::APIURL . '/schedule?country=' . $country .'&date='. $date;
		} else if($country == null && $date != null){
			$url = self::APIURL . '/schedule?date=' . $date;
		} else if($country != null && $date == null){
			$url = self::APIURL . '/schedule?country=' . $country;
		} else{
			$url = self::APIURL . '/schedule';
		}

		$schedule = $this->getFile($url);

		$show_list = [];
		foreach($schedule as $episode){
			$ep = new Episode($episode);
			$show = new TVShow($episode['show']);
			array_push($show_list, $show, $ep);
		}

		return $show_list;
	}
20555
public static function findByCountryAndCode($country, $code)
    {
        $country = is_object($country) ? $country->id : $country;

        return ProvinceProxy::byCountry($country)
                            ->where('code', $code)
                            ->take(1)
                            ->get()
                            ->first();
    }
51942
public function isVATCountry($countryCode)
    {
        $country = $this->getCountry($countryCode);

        return !is_null($country) && $country->usedVATOnCurrentDate();
    }