1 | <?php |
||
9 | trait SearchTrait |
||
10 | { |
||
11 | use ProviderTrait; |
||
12 | |||
13 | private $moduleSearchPage = "SearchPage"; |
||
14 | |||
15 | /** |
||
16 | * @return string |
||
17 | */ |
||
18 | abstract protected function getScope(); |
||
19 | |||
20 | /** |
||
21 | * Executes search to API. Query - search string. |
||
22 | * |
||
23 | * @param string $query |
||
24 | * @param string $scope |
||
25 | * @param array $bookmarks |
||
26 | * @return array |
||
27 | */ |
||
28 | public function searchCall($query, $scope, $bookmarks = []) |
||
37 | |||
38 | /** |
||
39 | * Executes search to API with pagination. |
||
40 | * |
||
41 | * @param string $query |
||
42 | * @param int $batchesLimit |
||
43 | * @return \Iterator |
||
44 | */ |
||
45 | public function searchWithPagination($query, $batchesLimit) |
||
54 | |||
55 | /** |
||
56 | * Creates Pinterest API search request |
||
57 | * |
||
58 | * @param $query |
||
59 | * @param $scope |
||
60 | * @param array $bookmarks |
||
61 | * @return array |
||
62 | */ |
||
63 | public function createSearchRequest($query, $scope, $bookmarks = []) |
||
72 | |||
73 | /** |
||
74 | * Search entities by search query |
||
75 | * |
||
76 | * @param string $query |
||
77 | * @param int $batchesLimit |
||
78 | * @return \Iterator |
||
79 | */ |
||
80 | public function search($query, $batchesLimit = 0) |
||
84 | |||
85 | /** |
||
86 | * @param $bookmarks |
||
87 | * @param $options |
||
88 | * @return array |
||
89 | */ |
||
90 | protected function appendBookMarks($bookmarks, $options) |
||
110 | } |