Hydrate a country element.

@param $countryCode
@param $element
@param $enabled
546275
public function hydrateCountryElement($countryCode, $element, $enabled)
    {
        if ($this->needsHydration($countryCode, $element, $enabled)) {
            $this->repository->countries[$countryCode] = $this->{'hydrate'.Str::studly($element)}($this->repository->countries[$countryCode]);
        }
    }
857194
public function updateCountry(Country $country, $andFlush = true)
    {
        $this->objectManager->persist($country);
        if ($andFlush) {
            $this->objectManager->flush();
        }
    }
64616
public function hydrateAdd($element)
    {
        $this->collection->add($element);

        // If _backRefFieldName is set and its a one-to-many association,
        // we need to set the back reference.
        if ($this->backRefFieldName && $this->association instanceof OneToManyAssociationMetadata) {
            $inversedAssociation = $this->typeClass->getProperty($this->backRefFieldName);

            // Set back reference to owner
            $inversedAssociation->setValue($element, $this->owner);

            $this->em->getUnitOfWork()->setOriginalEntityProperty(
                spl_object_id($element),
                $this->backRefFieldName,
                $this->owner
            );
        }
    }
1066878
private function confirmRemoval(
        InputInterface $input,
        OutputInterface $output,
        $countryCode
    ) {
        /**
         * @var QuestionHelper $questionHelper
         */
        $questionHelper = $this->getHelper('question');
        $message = "<question>Country with code '$countryCode' will be dropped. Continue?</question>";

        return $questionHelper->ask(
            $input,
            $output,
            new ConfirmationQuestion($message, false)
        );
    }
140863
protected function addCountry()
    {
        $this->controlAccess('country_add');

        if ($this->country->add($this->getSubmitted())) {
            $this->redirect('admin/settings/country', $this->text('Country has been added'), 'success');
        }

        $this->redirect('', $this->text('Country has not been added'), 'warning');
    }
864653
public static function countryLanguageCodes($countryCode)
    {
        $localeCodes = Locale::countryLocaleCodes($countryCode);

        $list = [];
        foreach ($localeCodes as $localeCode) {
            $list[] = Locale::languageCode($localeCode);
        }

        return $list;
    }
318409
@SuppressWarnings("unused")
    public void onCountryCodeSelected(String isoCode, String dialCode) {
        Country selectedCountry = new Country(isoCode, dialCode);
        countryCodeSelector.setSelectedCountry(selectedCountry);
    }
231582
public void setSelectedCountry(@NonNull Country country) {
        Log.d(TAG, "Selected country changed to " + country.getDisplayName());
        countryNameTextView.setText(country.getDisplayName());
        countryCodeTextView.setText(country.getDialCode());
        selectedCountry = country;
    }
673624
public static function country($code, $hydrate = true)
    {
        $code = mb_strtolower($code);

        if (! isset(static::$countries[$code])) {
            static::$countries[$code] = json_decode(static::getFile(__DIR__.'/../resources/data/'.$code.'.json'), true);
        }

        return $hydrate ? new Country(static::$countries[$code]) : static::$countries[$code];
    }
1287711
public function hydrateAdd($element)
    {
        $this->collection->add($element);

        // If _backRefFieldName is set and its a one-to-many association,
        // we need to set the back reference.
        if ($this->backRefFieldName && $this->association['type'] === ClassMetadata::ONE_TO_MANY) {
            // Set back reference to owner
            $this->typeClass->reflFields[$this->backRefFieldName]->setValue(
                $element, $this->owner
            );

            $this->em->getUnitOfWork()->setOriginalEntityProperty(
                spl_object_hash($element), $this->backRefFieldName, $this->owner
            );
        }
    }
588947
protected function getCountryIdByIso2Code($countryIso2Code): int
    {
        if (!isset(static::$countryIdsCache[$countryIso2Code])) {
            static::$countryIdsCache[$countryIso2Code] = SpyCountryQuery::create()
                ->findOneByIso2Code($countryIso2Code)
                ->getIdCountry();
        }

        return static::$countryIdsCache[$countryIso2Code];
    }
40796
function(enabledElement) {
  store.state.enabledElements.push(enabledElement);
  if (store.modules) {
    _initModulesOnElement(enabledElement);
  }
  _addGlobalToolsToElement(enabledElement);
  _repeatGlobalToolHistory(enabledElement);
}
906683
public function filterByCountry($countryCode)
    {
        $filteredArr = array();
        foreach ($this->_paymentMethodsArrayFiltered as $paymentMethod) {
            $continue = true;
            foreach ($paymentMethod["Issuers"] as $issuer) {
                foreach ($issuer["Countries"] as $country) {
                    if (strtoupper($country["CountryCode"]) == strtoupper($countryCode) || $country["CountryCode"] == "00") {
                        array_push($filteredArr, $paymentMethod);
                        $continue = false;
                    }
                    if (!$continue)
                        break;
                }
                if (!$continue)
                    break;
            }
        }
        $this->_paymentMethodsArrayFiltered = $filteredArr;
        return $this;
    }
919257
public function loadCountry($countryIso)
    {
        $content = $this
            ->locationLoaderAdapter
            ->getSqlForCountry($countryIso);

        $statement = $this
            ->locationEntityManager
            ->getConnection()
            ->prepare($content);

        $statement->execute();

        return $this;
    }
784583
function(enabledElement) {
  if (store.modules) {
    _cleanModulesOnElement(enabledElement);
  }

  const foundElementIndex = store.state.enabledElements.findIndex(
    element => element === enabledElement
  );

  if (foundElementIndex > -1) {
    store.state.enabledElements.splice(foundElementIndex, 1);
  } else {
    logger.warn('unable to remove element');
  }
}
1183162
public void onCountryCodeSelected(String country, String dialCode) {
        if (passwordlessRequestCodeLayout != null) {
            passwordlessRequestCodeLayout.onCountryCodeSelected(country, dialCode);
        }
    }
170237
protected function needsHydration($countryCode, $element, $enabled = false)
    {
        if (! $this->canHydrate($element, $enabled, $countryCode)) {
            return false;
        }

        return $this->updateHydrated($countryCode, $element);
    }