getUserSubscriptions methods in UserApi.
This commit is contained in:
parent
c5f63d86cb
commit
4dfda21401
|
@ -78,6 +78,40 @@ class UserApi extends AbstractApi
|
|||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user subscriptions by user login
|
||||
*
|
||||
* @param string $login
|
||||
* @return User[]
|
||||
*/
|
||||
public function getUserSubscriptionsByLogin($login)
|
||||
{
|
||||
$usersList = $this->getGetRequestData('/api/user/' . $login . '/subscriptions', [], true);
|
||||
|
||||
$users = $this->getUsersFromList($usersList);
|
||||
|
||||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user subscriptions by user id
|
||||
*
|
||||
* @param int $id
|
||||
* @return User[]
|
||||
*/
|
||||
public function getUserSubscriptionsById($id)
|
||||
{
|
||||
if (!is_numeric($id)) {
|
||||
throw new \InvalidArgumentException('$id must be an integer');
|
||||
}
|
||||
|
||||
$usersList = $this->getGetRequestData('/api/user/id/' . (int) $id . '/subscriptions', [], true);
|
||||
|
||||
$users = $this->getUsersFromList($usersList);
|
||||
|
||||
return $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User[]
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue