php-isocodes icon indicating copy to clipboard operation
php-isocodes copied to clipboard

getParent() not working with php-isocodes-db-i18n

Open Ronan-Lenor opened this issue 10 months ago • 0 comments

Because the .json files aren't filled

e.g. with GB-ABC :

$sokilTranslationDriver = new \Sokil\IsoCodes\TranslationDriver\SymfonyTranslationDriver();
$sokilTranslationDriver->setLocale('en');
$sokilIsoCodes = new \Sokil\IsoCodes\IsoCodesFactory(null, $sokilTranslationDriver);

$sokilSubdivision = $sokilIsoCodes->getSubdivisions()->getByCode('GB-ABC');

call : .\src\Database\SubdivisionsPartitioned.php > loadFromJSONFile() then : $pathToPartitionFile = sprintf(...) return ".\vendor\sokil\php-isocodes\src/../../php-isocodes-db-i18n/databases/iso_3166-2/GB.json"

but sokil\php-isocodes-db-i18n\databases\iso_3166-2\GB.json don't have the parent key.

while sokil\php-isocodes-db-i18n\databases\iso_3166-2.json has "parent": "GB-NIR"

Ronan-Lenor avatar Mar 04 '25 15:03 Ronan-Lenor