@@ 434-447 (lines=14) @@ | ||
431 | * |
|
432 | * @return array|Answer |
|
433 | */ |
|
434 | public function getOfUserIds($ids, array $params = ['site' => 'stackoverflow'], $serialize = true) |
|
435 | { |
|
436 | if ($this->authentication instanceof Authentication) { |
|
437 | if (true === empty($params)) { |
|
438 | $params = array_merge($params, self::QUERY_PARAMS); |
|
439 | } |
|
440 | $params = array_merge($params, $this->authentication->toArray()); |
|
441 | } |
|
442 | $response = HttpClient::instance()->get( |
|
443 | 'users/' . (is_array($ids) ? implode(';', $ids) : $ids) . '/' . self::URL, $params |
|
444 | ); |
|
445 | ||
446 | return $serialize === true ? AnswerSerializer::serialize($response) : $response; |
|
447 | } |
|
448 | ||
449 | /** |
|
450 | * Returns the answers owned by the user associated with the given access_token. |
|
@@ 485-498 (lines=14) @@ | ||
482 | * |
|
483 | * @return array|Answer |
|
484 | */ |
|
485 | public function getTopOfUserAndTags($userId, $tags, array $params = ['site' => 'stackoverflow'], $serialize = true) |
|
486 | { |
|
487 | if ($this->authentication instanceof Authentication) { |
|
488 | if (true === empty($params)) { |
|
489 | $params = array_merge($params, self::QUERY_PARAMS); |
|
490 | } |
|
491 | $params = array_merge($params, $this->authentication->toArray()); |
|
492 | } |
|
493 | $response = HttpClient::instance()->get( |
|
494 | 'users/' . $userId . '/tags/' . (is_array($tags) ? implode(';', $tags) : $tags) . '/top-' . self::URL, $params |
|
495 | ); |
|
496 | ||
497 | return $serialize === true ? AnswerSerializer::serialize($response) : $response; |
|
498 | } |
|
499 | ||
500 | /** |
|
501 | * Returns the top 30 answers the user associated with the given |