Skip to content

Commit

Permalink
[Autocomplete] Add throwing an exception when trying to set options w…
Browse files Browse the repository at this point in the history
…hen the form is already existing
  • Loading branch information
jakubtobiasz committed Feb 4, 2024
1 parent 639886d commit db61002
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ private function getEntityMetadata(): EntityMetadata

public function setOptions(array $options): void
{
if (null !== $this->form) {
throw new \LogicException('The options can only be set before the form is created.');
}

$this->options = $options;
}
}

0 comments on commit db61002

Please sign in to comment.