1 | <?php |
||
9 | abstract class SearchProvider extends Provider |
||
10 | { |
||
11 | use PaginationHelper; |
||
12 | protected $moduleSearchPage = "SearchPage"; |
||
13 | |||
14 | /** |
||
15 | * @return string |
||
16 | */ |
||
17 | abstract protected function getScope(); |
||
18 | |||
19 | /** |
||
20 | * Executes search to API. Query - search string. |
||
21 | * |
||
22 | * @param string $query |
||
23 | * @param string $scope |
||
24 | * @param array $bookmarks |
||
25 | * @return array |
||
26 | */ |
||
27 | public function searchCall($query, $scope, $bookmarks = []) |
||
36 | |||
37 | /** |
||
38 | * Executes search to API with pagination. |
||
39 | * |
||
40 | * @param string $query |
||
41 | * @param int $batchesLimit |
||
42 | * @return \Iterator |
||
43 | */ |
||
44 | public function searchWithPagination($query, $batchesLimit) |
||
53 | |||
54 | /** |
||
55 | * Creates Pinterest API search request |
||
56 | * |
||
57 | * @param $query |
||
58 | * @param $scope |
||
59 | * @param array $bookmarks |
||
60 | * @return array |
||
61 | */ |
||
62 | public function createSearchRequest($query, $scope, $bookmarks = []) |
||
88 | |||
89 | /** |
||
90 | * Search entities by search query |
||
91 | * |
||
92 | * @param string $query |
||
93 | * @param int $batchesLimit |
||
94 | * @return \Iterator |
||
95 | */ |
||
96 | public function search($query, $batchesLimit = 0) |
||
100 | } |