Licitator 1.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1007 B

5 years ago
  1. <?php
  2. namespace Zitec\RuleEngineBundle\Autocomplete;
  3. /**
  4. * Interface AutocompleteInterface
  5. * Interface for an autocomplete data source service.
  6. */
  7. interface AutocompleteInterface
  8. {
  9. /**
  10. * Get autocomplete suggestions based on a search string.
  11. *
  12. * @param string $queryString
  13. * The user search string.
  14. * @param int $page
  15. * The page number for paginated results.
  16. *
  17. * @return array
  18. * An and array consisting of a collection of items where each item is an object with id and text properties
  19. * and a "more" flag indicating partial (paged) results.
  20. */
  21. public function getSuggestions(string $queryString, int $page = 1): array;
  22. /**
  23. * Retrieve the text parameter of existing ids to populate the front end autocomplete element.
  24. *
  25. * @param array $ids
  26. *
  27. * @return array
  28. * An array of items where each item is an object with id and text properties.
  29. */
  30. public function getLabels(array $ids): array;
  31. }