Skip to content
Snippets Groups Projects
Commit bdafdf15 authored by Christophe Goffin's avatar Christophe Goffin Committed by BramDriesen
Browse files

Issue #3298269: Error in PostalCodeHelper::getPostalCodeByMunicipality

parent be43abed
Branches
Tags 1.0.0-alpha3
1 merge request!2Issue #3298269: Error in PostalCodeHelper::getPostalCodeByMunicipality
...@@ -73,17 +73,14 @@ class PostalCodeHelper implements PostalCodeHelperInterface { ...@@ -73,17 +73,14 @@ class PostalCodeHelper implements PostalCodeHelperInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getPostalCodeByMunicipality(string $municipality): ?TermInterface { public function getPostalCodeByMunicipality(string $municipality): ?TermInterface {
$term_ids = $this->entityTypeManager $terms = $this->entityTypeManager
->getStorage('taxonomy_term') ->getStorage('taxonomy_term')
->loadByProperties([ ->loadByProperties([
'name' => $municipality, 'name' => $municipality,
'vid' => 'belgian_postal_code', 'vid' => 'belgian_postal_code',
]); ]);
if ($term_ids) { if ($terms) {
$terms = $this->entityTypeManager
->getStorage('taxonomy_term')
->loadMultiple($term_ids);
return reset($terms); return reset($terms);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment