Skip to content

Commit

Permalink
[Autocomplete] Avoid handling InvalidArgumentException
Browse files Browse the repository at this point in the history
  • Loading branch information
evertharmeling committed Feb 15, 2024
1 parent a346940 commit 81b4807
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Autocomplete/src/Doctrine/EntityMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public function getAssociationMetadata(string $propertyName): array

public function getPropertyDataType(string $propertyName): string
{
try {
if (\array_key_exists($propertyName, $this->metadata->fieldMappings)) {
return $this->getFieldMetadata($propertyName)['type'];
} catch (\InvalidArgumentException $e) {
return $this->getAssociationMetadata($propertyName)['type'];
}

return $this->getAssociationMetadata($propertyName)['type'];
}

public function getIdValue(object $entity): string
Expand Down

0 comments on commit 81b4807

Please sign in to comment.