Get user subscribers by id.

This commit is contained in:
Alexey Skobkin 2015-06-01 00:19:03 +03:00
parent 055b967996
commit 76d75542fd
1 changed files with 19 additions and 0 deletions

View File

@ -59,6 +59,25 @@ class UserApi extends AbstractApi
return $users;
}
/**
* Get user subscribers by user id
*
* @param int $id
* @return User[]
*/
public function getUserSubscribersById($id)
{
if (!is_numeric($id)) {
throw new \InvalidArgumentException('$id must be an integer');
}
$usersList = $this->getGetRequestData('/api/user/id/' . (int) $id . '/subscribers', [], true);
$users = $this->getUsersFromList($usersList);
return $users;
}
/**
* @return User[]
*/