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