1: <?php
2:
3: namespace Mapbender\CoreBundle\Component;
4:
5: use Symfony\Component\DependencyInjection\ContainerInterface;
6:
7: /**
8: * Search engine interface for use by search classes used by SearchRouter
9: * element.
10: *
11: * @author Christian Wygoda
12: */
13: interface SearchEngine
14: {
15:
16: /**
17: * Constructor, receives the DI container for access to everything else.
18: *
19: * @param ContainerInterface $container DI container
20: */
21: public function __construct(ContainerInterface $container);
22:
23: /**
24: * Autocomplete handler
25: *
26: * @param string $target Field to autocomple for
27: * @param string $term Term to autocomplete for
28: * @param array $data Values of all form fields
29: * @param string $srs current map srs
30: * @param array $extent current map extent
31: * @return array Autocomplete suggestions with label, value and
32: * optionally key attributes
33: */
34: public function autocomplete($target, $term, $data, $srs, $extent);
35:
36: /**
37: * Search handler
38: * @param array $conf Form configuration
39: * @param array $data Data: Array with form data array and
40: * autocomplete_keys array (may be empty)
41: * @param string $srs current map srs
42: * @param array $extent current map extent
43: * @return array Result set array
44: */
45: public function search(array $conf, array $data, $srs, $extent);
46: }