1 | <?php |
||
10 | class SearchConsole |
||
11 | { |
||
12 | /** @var SearchConsoleClient */ |
||
13 | protected $client; |
||
14 | |||
15 | /** |
||
16 | * @param SearchConsoleClient $client |
||
17 | */ |
||
18 | public function __construct(SearchConsoleClient $client) |
||
22 | |||
23 | /** |
||
24 | * @param string $quotaUser |
||
25 | * |
||
26 | * @return $this |
||
27 | */ |
||
28 | public function setQuotaUser(string $quotaUser) |
||
34 | |||
35 | /** |
||
36 | * @param string|array $accessToken |
||
37 | * |
||
38 | * @return $this |
||
39 | */ |
||
40 | public function setAccessToken($accessToken) |
||
52 | |||
53 | /** |
||
54 | * @param string $siteUrl |
||
55 | * @return array |
||
56 | */ |
||
57 | public function getSite(string $siteUrl) |
||
70 | |||
71 | public function listSites() |
||
87 | |||
88 | /** |
||
89 | * Call the query method on the authenticated client. |
||
90 | * |
||
91 | * @param string $siteUrl |
||
92 | * @param Period $period |
||
93 | * @param array $dimensions |
||
94 | * @param array $filters |
||
95 | * @param int $rows |
||
96 | * @param string $searchType |
||
97 | * @return Collection |
||
98 | * @throws \Exception |
||
99 | */ |
||
100 | public function searchAnalyticsQuery(string $siteUrl, Period $period, array $dimensions = [], array $filters = [], int $rows = 1000, string $searchType = 'web') |
||
111 | |||
112 | public function isAccessTokenExpired() |
||
126 | |||
127 | /* |
||
128 | * Get the underlying Google_Service_Webmasters object. You can use this |
||
129 | * to basically call anything on the Google Search Console API. |
||
130 | */ |
||
131 | public function getWebmastersService(): \Google_Service_Webmasters |
||
135 | |||
136 | private function applyFilters(Google_Service_Webmasters_SearchAnalyticsQueryRequest $request, $filters) |
||
158 | } |
||
159 |