protected function listGetData($url, $maxpages = 1, $token = null)
	{
		$qurl = $url;

		if (strpos($url, '&') && isset($token))
		{
			$qurl .= '&pageToken=' . $token;
		}
		elseif (isset($token))
		{
			$qurl .= 'pageToken=' . $token;
		}

		$jdata = $this->query($qurl);
		$data = json_decode($jdata->body, true);

		if ($data && array_key_exists('items', $data))
		{
			if ($maxpages != 1 && array_key_exists('nextPageToken', $data))
			{
				$data['items'] = array_merge($data['items'], $this->listGetData($url, $maxpages - 1, $data['nextPageToken']));
			}

			return $data['items'];
		}
		elseif ($data)
		{
			return array();
		}
		else
		{
			throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
		}
	}
protected function listGetData($url, $maxpages = 1, $token = null)
	{
		$qurl = $url;

		if (strpos($url, '&') && isset($token))
		{
			$qurl .= '&pageToken=' . $token;
		}
		elseif (isset($token))
		{
			$qurl .= 'pageToken=' . $token;
		}

		$jdata = $this->query($qurl);
		$data = json_decode($jdata->body, true);

		if ($data && array_key_exists('items', $data))
		{
			if ($maxpages != 1 && array_key_exists('nextPageToken', $data))
			{
				$data['items'] = array_merge($data['items'], $this->listGetData($url, $maxpages - 1, $data['nextPageToken']));
			}

			return $data['items'];
		}
		elseif ($data)
		{
			return array();
		}
		else
		{
			throw new UnexpectedValueException("Unexpected data received from Google: `{$jdata->body}`.");
		}
	}
protected function listGetData ( $ url , $ maxpages = 1 , $ token = null ) { $ qurl = $ url ; if ( strpos ( $ url , '&' ) && isset ( $ token ) ) { $ qurl .= '&pageToken=' . $ token ; } elseif ( isset ( $ token ) ) { $ qurl .= 'pageToken=' . $ token ; } $ jdata = $ this -> query ( $ qurl ) ; $ data = json_decode ( $ jdata -> body , true ) ; if ( $ data && array_key_exists ( 'items' , $ data ) ) { if ( $ maxpages != 1 && array_key_exists ( 'nextPageToken' , $ data ) ) { $ data [ 'items' ] = array_merge ( $ data [ 'items' ] , $ this -> listGetData ( $ url , $ maxpages - 1 , $ data [ 'nextPageToken' ] ) ) ; } return $ data [ 'items' ] ; } elseif ( $ data ) { return array ( ) ; } else { throw new UnexpectedValueException ( "Unexpected data received from Google: `{$jdata->body}`." ) ; } }
Method to retrieve a list of data

@param   array    $url       URL to GET
@param   integer  $maxpages  Maximum number of pages to return
@param   string   $token     Next page token

@return  mixed  Data from Google

@since   1.0
@throws  UnexpectedValueException
Method to retrieve a list of data