@param int $idCountry
@param string|null $iso2Code
@param string|null $iso3Code

@return void
510700
protected function addIdCountryToCache($idCountry, $iso2Code, $iso3Code): void
    {
        if ($iso2Code !== null) {
            $this->idCountryCache[$iso2Code] = $idCountry;
        }
        if ($iso3Code !== null) {
            $this->idCountryCache[$iso3Code] = $idCountry;
        }
    }
1179242
protected function getIdCountryFromDatabase($iso2Code, $iso3Code): int
    {
        $countryQuery = SpyCountryQuery::create();
        $countryQuery->select(SpyCountryTableMap::COL_ID_COUNTRY);

        if ($iso2Code !== null) {
            $countryQuery->filterByIso2Code($iso2Code);
        }

        if ($iso3Code !== null) {
            $countryQuery->filterByIso3Code($iso3Code);
        }

        /** @var int $idCountry */
        $idCountry = $countryQuery->findOne();

        if (!$idCountry) {
            throw new EntityNotFoundException(sprintf('Could not find a country by iso2_code "%s" or iso3_code "%s"!', $iso2Code, $iso3Code));
        }

        $this->addIdCountryToCache($idCountry, $iso2Code, $iso3Code);

        return $idCountry;
    }
223036
public function setCountry(\Tx_Oelib_Model_Country $country = null)
    {
        $countryCode = ($country !== null) ? $country->getIsoAlpha3Code() : '';

        $this->setAsString('static_info_country', $countryCode);
    }
689023
@Override
  public final void initialize(final BankCountry pconstraintAnnotation) {
    this.fieldCountryCode = pconstraintAnnotation.fieldCountryCode();
    this.allowLowerCaseCountryCode = pconstraintAnnotation.allowLowerCaseCountryCode();
    this.fieldIban = pconstraintAnnotation.fieldIban();
    this.fieldBic = pconstraintAnnotation.fieldBic();
    this.message = pconstraintAnnotation.message();
    this.messageWrongBic = pconstraintAnnotation.messageWrongBic();
  }
761102
public function showAction($iso_code)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('OrkestroCountryBundle:Country')->findOneBy(array(
                'isoCode' => $iso_code,
            ));

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Country entity.');
        }

        $deleteForm = $this->createDeleteForm($iso_code);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }
1331325
public function getCountry($id)
    {
        foreach ($this->data as $country) {
            if (strtoupper($id) == (string) $country) {
                return $country;
            }
        }

        return null;
    }
482282
protected function updateCountry($code)
    {
        if (!$this->isError() && !$this->country->update($code, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1024490
public function getUserCountryId($sCountry = null)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sQ = "select oxid from " . getviewName("oxcountry") . " where oxactive = '1' and oxisoalpha2 = " . $oDb->quote($sCountry) . " ";
        $sCountryId = $oDb->getOne($sQ);

        return $sCountryId;
    }
915764
public function insertChild ($relationIdentifier, $id, $row, $foreignKey = null)
		{
			$relation = $this->getRelation($relationIdentifier);

			if (! $relation) {
				throw new RelationException('Invalid relation `' . $relationIdentifier);
			}

			if ($relation instanceof OneToMany || $relation instanceof OneToOne) {
				if (is_null($foreignKey)) {
					$foreignKey = $this->getPrimaryKey();
				}

				$row[$foreignKey] = $id;

				$this->database->createQuery()
					->insert()
					->into($relation->getRelatedTable())
					->set($row)
					->execute();

				return $this->database->insertId();

			} else if ($relation instanceof ManyToMany) {
				if (is_null($foreignKey)) {
					$foreignKey = $this->getPrimaryKey();
				}

				$childId = $this->database->createQuery()
					->insert()
					->into($relation->getRelatedTable())
					->set($row)
					->execute();

				$data = array(
					$foreignKey => $id,
					$this->database->primaryKey($relation->getRelatedTable()) => $childId,
				);

				$this->database->createQuery()
					->insert()
					->into($relation->getRelationalTable())
					->set($data)
					->execute();

				return $childId;

			} else {
				throw new RelationException('Invalid relation type `' . gettype($relation) . '`');
			}
		}
665455
@Override
	public int countByC_C(long commerceCountryId, String code) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_C_C;

		Object[] finderArgs = new Object[] { commerceCountryId, code };

		Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(3);

			query.append(_SQL_COUNT_COMMERCEREGION_WHERE);

			query.append(_FINDER_COLUMN_C_C_COMMERCECOUNTRYID_2);

			boolean bindCode = false;

			if (code == null) {
				query.append(_FINDER_COLUMN_C_C_CODE_1);
			}
			else if (code.equals("")) {
				query.append(_FINDER_COLUMN_C_C_CODE_3);
			}
			else {
				bindCode = true;

				query.append(_FINDER_COLUMN_C_C_CODE_2);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(commerceCountryId);

				if (bindCode) {
					qPos.add(code);
				}

				count = (Long)q.uniqueResult();

				finderCache.putResult(finderPath, finderArgs, count);
			}
			catch (Exception e) {
				finderCache.removeResult(finderPath, finderArgs);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
187605
public function origin($province = null, $id = null)
    {
        return $this->request($this->api_version . '/internationalOrigin', [
            'province' => $province,
            'id' => $id,
        ]);
    }
349116
public static function getCurrencyId($isoCode)
    {
        $allCurrencies = self::getAll();

        foreach ($allCurrencies as $currency) {
            if (strcasecmp($currency['abbreviation'], $isoCode) === 0) {
                return $currency['id'];
            }
        }
        throw new NotFound('Currency', $isoCode);
    }
453448
public function getIdByIso($isoCode) {
		$match = ['DE' => 1, 'AT' => 2, 'CH' => 3];

		$isoCode = strtoupper($isoCode);
		if (array_key_exists($isoCode, $match)) {
			return $match[$isoCode];
		}

		throw new InvalidArgumentException('ISO code not valid: ' . $isoCode);
	}
1022919
public function formatForMobileDialingInCountry($country, $removeFormatting = false)
    {
        if (! static::isValidCountryCode($country)) {
            throw CountryCodeException::invalid($country);
        }

        return $this->lib->formatNumberForMobileDialing(
            $this->getPhoneNumberInstance(),
            $country,
            $removeFormatting
        );
    }
1274487
private function getCountryByIsoCode( $iso_code ) {
		global $wpdb;
		$query          = "SELECT * FROM {$wpdb->base_prefix}geot_countries WHERE iso_code = %s";
		$result         = $wpdb->get_row( $wpdb->prepare( $query, array( $iso_code ) ), ARRAY_A );
		$country        = new \StdClass();
		$country->names = new \StdClass();

		$country->names->en = $result['country'];
		$country->iso_code  = $result['iso_code'];

		return $country;
	}
453175
public final void setCountryCode(final String pcountryCode, final Locale plocale) {
    if (StringUtils.isEmpty(pcountryCode)) {
      defaultCountryData = null;
    } else {
      defaultCountryData =
          CreatePhoneCountryConstantsClass.create(plocale).countryMap().get(pcountryCode);
    }
  }
1266701
@Nullable
  public static IBANCountryData getCountryData (@Nonnull final String sCountryCode)
  {
    ValueEnforcer.notNull (sCountryCode, "CountryCode");

    return s_aIBANData.get (sCountryCode.toUpperCase (Locale.US));
  }