Skip to content

Commit db61002

Browse files
committed
[Autocomplete] Add throwing an exception when trying to set options when the form is already existing
1 parent 639886d commit db61002

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Autocomplete/src/Form/WrappedEntityTypeAutocompleter.php

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ private function getEntityMetadata(): EntityMetadata
172172

173173
public function setOptions(array $options): void
174174
{
175+
if (null !== $this->form) {
176+
throw new \LogicException('The options can only be set before the form is created.');
177+
}
178+
175179
$this->options = $options;
176180
}
177181
}

0 commit comments

Comments
 (0)