private function getCountryByCode($code)
    {
        // Check if country exist in cache.
        if (array_key_exists($code, $this->countries)) {
            return $this->countries[$code];
        }
        // Fetch country.
        $country = $this->manager->getRepository(static::$countryEntityName)->findOneBy(['code' => $code]);
        if (!$country) {
            throw new \Doctrine\ORM\EntityNotFoundException('code = ' . $code);
        }
        // Add country to cache.
        $this->countries[$code] = $country;

        return $country;
    }