Получаем объект региона по коду субъекта РФ.

@param string|int $region_code

@return AutoRegionEntry|null
554717
public function getByRegionCode($region_code)
    {
        if (\is_scalar($region_code)) {
            // Очищаем входящее значение и приводим к числу
            $region_code = (int) \preg_replace('~\D~', '', $region_code);
            foreach ($this->items as $region) {
                if ($region->getRegionCode() === $region_code) {
                    return $region;
                }
            }
        }
    }
1208815
protected function classForCode($code)
    {
        if (isset(self::$respClassMap[$code])) {
            return self::$respClassMap[$code];
        }

        return null;
    }
1043591
public function getAuthorizationCode($code)
    {
        $code = $this->collection('code_table')->findOne(array(
            'authorization_code' => $code
        ));
        return is_null($code) ? false : $code;
    }
1073016
public function getSectionType($section, $code)
    {
        if (!isset($this->types[$section])) {
            return null;
        }

        $types = array_filter(
            $this->types[$section],
            function (ImageType $item) use ($code) {
                return strtolower($code) === strtolower($item->getCode());
            }
        );

        return array_values($types)[0];
    }
1052905
public function searchLocation($code, $countryId = null, $options = []) {
		if (!empty($options['exact'])) {
			if (!empty($options['term'])) {
				$term = sprintf($options['term'], $code);
			} else {
				$term = $code . '%';
			}
			$search = ['code LIKE' => "$term"];
		} else {
			$search = ['code' => $code];
		}

		if ($countryId) {
			$search['country_id'] = (int)$countryId;
		}

		$options = [
			'conditions' => $search,
			'limit' => 15,
		];
		return $this->find('all', $options);
	}
6167
public function getCD($region, $credential)
    {
        if (!$config = $this->getConfigWithCredentials($region, $credential)) {
            return null;
        }

        return $this->aws->createCodeDeploy($config);
    }
608918
protected function setCountry($country_code)
    {
        $this->data_country = array();

        if (!empty($country_code)) {
            $this->data_country = $this->country->get($country_code);
            if (empty($this->data_country)) {
                $this->outputHttpStatus(404);
            }
        }
    }
1141719
public static CommerceRegion removeByC_C(long commerceCountryId, String code)
		throws com.liferay.commerce.exception.NoSuchRegionException {
		return getPersistence().removeByC_C(commerceCountryId, code);
	}
1352946
public function getCurrency( $iso_code ) {

		$currencies = $this->all();
		if ( isset( $currencies[ $iso_code ] ) ) {
			return $currencies[ $iso_code ];
		}

		return null;
	}
1336171
public static function countryContinentCode($countryCode)
    {
        foreach (static::CODES as $code => $countryCodes) {
            if (in_array($countryCode, $countryCodes)) {
                return $code;
            }
        }

        return null;
    }
220350
public function populateCountry($countryCode)
    {
        $rootLocation = $this
            ->locationPopulatorAdapter
            ->populate($countryCode);

        $this
            ->locationObjectManager
            ->persist($rootLocation);

        $this
            ->locationObjectManager
            ->flush($rootLocation);

        return $this;
    }
550460
@Override
    public CountryContract getCountryFromCode(String countryCode) {
        if(StringUtils.isBlank(countryCode)) return null;
        CountryContract country = getKcCountryService().getCountryByAlternateCode(countryCode);
        if(country==null){
            country = getKcCountryService().getCountry(countryCode);
        }
        return country;
    }
835440
public function getChildrenValue($code, $row = [])
    {
        $number = $this->getChildrenColumnNumber($code);

        if ($number !== null)
        {
            return $row[$number];
        }

        return null;
    }
340380
protected function UFGetIdByCode($entity, $code)
    {
        $rsData = CUserTypeEntity::GetList([], [
            'ENTITY_ID' => $entity,
            'FIELD_NAME' => $code,
        ]);
        if ($ob = $rsData->GetNext()) {
            return $ob['ID'];
        } else {
            return null;
        }
    }
611244
public function getCodePipeline($region, $credential)
    {
        if (!$config = $this->getConfigWithCredentials($region, $credential)) {
            return null;
        }

        return $this->aws->createCodePipeline($config);
    }
1251464
public RegionInfo queryRegionInfo(RegionReqInfo regionReqInfo) {
        try {
            return queryRegionInfo(regionReqInfo.getAccessKey(), regionReqInfo.getBucket());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
8356
public static function convertRegionCodeToIso($countryCode, $fipsRegionCode, $returnOriginalIfNotFound = false)
    {
        static $mapping;
        if(empty($mapping)) {
            $mapping = include __DIR__ . '/../data/regionMapping.php';
        }
        $countryCode = strtoupper($countryCode);
        if (empty($countryCode) || in_array($countryCode, ['EU', 'AP', 'A1', 'A2'])) {
            return ['', ''];
        }
        if (in_array($countryCode, ['US', 'CA'])) { // US and CA always haven been iso codes
            return [$countryCode, $fipsRegionCode];
        }
        if ($countryCode == 'TI') {
            $countryCode = 'CN';
            $fipsRegionCode = '14';
        }
        $isoRegionCode = $returnOriginalIfNotFound ? $fipsRegionCode : '';
        if (!empty($fipsRegionCode) && !empty($mapping[$countryCode][$fipsRegionCode])) {
            $isoRegionCode = $mapping[$countryCode][$fipsRegionCode];
        }
        return [$countryCode, $isoRegionCode];
    }