|
@@ 424-437 (lines=14) @@
|
| 421 |
|
* |
| 422 |
|
* @return array|Answer |
| 423 |
|
*/ |
| 424 |
|
public function getOfUserIds($ids, array $params = ['site' => 'stackoverflow'], $serialize = true) |
| 425 |
|
{ |
| 426 |
|
if ($this->authentication instanceof Authentication) { |
| 427 |
|
if (true === empty($params)) { |
| 428 |
|
$params = array_merge($params, self::QUERY_PARAMS); |
| 429 |
|
} |
| 430 |
|
$params = array_merge($params, $this->authentication->toArray()); |
| 431 |
|
} |
| 432 |
|
$response = Http::instance()->get( |
| 433 |
|
'users/' . (is_array($ids) ? implode(';', $ids) : $ids) . '/' . self::URL, $params |
| 434 |
|
); |
| 435 |
|
|
| 436 |
|
return $serialize === true ? AnswerSerializer::serialize($response) : $response; |
| 437 |
|
} |
| 438 |
|
|
| 439 |
|
/** |
| 440 |
|
* Returns the answers owned by the user associated with the given access_token. |
|
@@ 475-488 (lines=14) @@
|
| 472 |
|
* |
| 473 |
|
* @return array|Answer |
| 474 |
|
*/ |
| 475 |
|
public function getTopOfUserAndTags($userId, $tags, array $params = ['site' => 'stackoverflow'], $serialize = true) |
| 476 |
|
{ |
| 477 |
|
if ($this->authentication instanceof Authentication) { |
| 478 |
|
if (true === empty($params)) { |
| 479 |
|
$params = array_merge($params, self::QUERY_PARAMS); |
| 480 |
|
} |
| 481 |
|
$params = array_merge($params, $this->authentication->toArray()); |
| 482 |
|
} |
| 483 |
|
$response = Http::instance()->get( |
| 484 |
|
'users/' . $userId . '/tags/' . (is_array($tags) ? implode(';', $tags) : $tags) . '/top-' . self::URL, $params |
| 485 |
|
); |
| 486 |
|
|
| 487 |
|
return $serialize === true ? AnswerSerializer::serialize($response) : $response; |
| 488 |
|
} |
| 489 |
|
|
| 490 |
|
/** |
| 491 |
|
* Returns the top 30 answers the user associated with the given |