• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/vkontakte.php
  • Класс: CVKontakteOAuthInterface
  • Вызов: CVKontakteOAuthInterface::GetCurrentUserFriends
public function GetCurrentUserFriends($limit, &$next)
{
	if ($this->access_token === false)
	{
		return false;
	}

	$url = self::FRIENDS_URL . '?v='.self::API_VERSION.'&uids=' . $this->userID . '&fields=uid,first_name,last_name,nickname,screen_name,photo_200_orig,contacts,email&access_token=' . urlencode($this->access_token);

	if ($limit > 0)
	{
		$url .= "&count=" . intval($limit) . "&offset=" . intval($next);
	}

	$h = new BitrixMainWebHttpClient();
	$h->setTimeout($this->httpTimeout);

	$result = $h->get($url);

	try
	{
		$result = BitrixMainWebJson::decode($result);
	} catch (BitrixMainArgumentException $e)
	{
		$result = array();
	}

	$next = $limit + $next;

	return $result;
}