File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
tests/Fixtures/Autocompleter Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1818/**
1919 * Interface for classes that will have an "autocomplete" endpoint exposed.
2020 *
21+ * @template T of object
22+ *
2123 * @method mixed getGroupBy() Return group_by option.
2224 */
2325interface EntityAutocompleterInterface
2426{
2527 /**
2628 * The fully-qualified entity class this will be autocompleting.
29+ *
30+ * @return class-string<T>
2731 */
2832 public function getEntityClass (): string ;
2933
3034 /**
3135 * Create a query builder that filters for the given "query".
36+ *
37+ * @param EntityRepository<T> $repository
3238 */
3339 public function createFilteredQueryBuilder (EntityRepository $ repository , string $ query ): QueryBuilder ;
3440
3541 /**
3642 * Returns the "choice_label" used to display this entity.
43+ *
44+ * @param T $entity
3745 */
3846 public function getLabel (object $ entity ): string ;
3947
4048 /**
4149 * Returns the "value" attribute for this entity, usually the id.
50+ *
51+ * @param T $entity
4252 */
4353 public function getValue (object $ entity ): mixed ;
4454
Original file line number Diff line number Diff line change 1919use Symfony \UX \Autocomplete \EntityAutocompleterInterface ;
2020use Symfony \UX \Autocomplete \Tests \Fixtures \Entity \Product ;
2121
22+ /**
23+ * @implements EntityAutocompleterInterface<Product>
24+ */
2225class CustomProductAutocompleter implements EntityAutocompleterInterface
2326{
2427 public function __construct (
You can’t perform that action at this time.
0 commit comments