Get user subscribers by id.

This commit is contained in:
Alexey Skobkin 2015-06-01 00:19:03 +03:00
parent 055b967996
commit 76d75542fd

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[]
*/