Source for file activities.php
Documentation is available at activities.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE
* Google+ data class for the Joomla Platform.
* @package Joomla.Platform
* @param JRegistry $options Google options object
* @param JGoogleAuth $auth Google data http client object
public function __construct(JRegistry $options =
null, JGoogleAuth $auth =
null)
if (isset
($this->auth) &&
!$this->auth->getOption('scope'))
$this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me');
* List all of the activities in the specified collection for a particular user.
* @param string $userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user.
* @param string $collection The collection of activities to list. Acceptable values are: "public".
* @param string $fields Used to specify the fields you want returned.
* @param integer $max The maximum number of people to include in the response, used for paging.
* @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this
* parameter to the value of "nextPageToken" from the previous response. This token may be of any length.
* @param string $alt Specifies an alternative representation type. Acceptable values are: "json" - Use JSON format (default)
* @return mixed Data from Google
public function listActivities($userId, $collection, $fields =
null, $max =
10, $token =
null, $alt =
null)
$url =
$this->getOption('api.url') .
'people/' .
$userId .
'/activities/' .
$collection;
// Check if fields is specified.
$url .=
'?fields=' .
$fields;
// Check if max is specified.
$url .=
(strpos($url, '?') ===
false) ?
'?maxResults=' :
'&maxResults=';
// Check if token is specified.
$url .=
(strpos($url, '?') ===
false) ?
'?pageToken=' :
'&pageToken=';
// Check if alt is specified.
$url .=
(strpos($url, '?') ===
false) ?
'?alt=' :
'&alt=';
$jdata =
$this->auth->query($url);
* @param string $id The ID of the activity to get.
* @param string $fields Used to specify the fields you want returned.
* @param string $alt Specifies an alternative representation type. Acceptable values are: "json" - Use JSON format (default)
* @return mixed Data from Google
public function getActivity($id, $fields =
null, $alt =
null)
$url =
$this->getOption('api.url') .
'activities/' .
$id;
// Check if fields is specified.
$url .=
'?fields=' .
$fields;
// Check if alt is specified.
$url .=
(strpos($url, '?') ===
false) ?
'?alt=' :
'&alt=';
$jdata =
$this->auth->query($url);
* Search all public activities.
* @param string $query Full-text search query string.
* @param string $fields Used to specify the fields you want returned.
* @param string $language Specify the preferred language to search with. https://developers.google.com/+/api/search#available-languages
* @param integer $max The maximum number of people to include in the response, used for paging.
* @param string $order Specifies how to order search results. Acceptable values are "best" and "recent".
* @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this
* parameter to the value of "nextPageToken" from the previous response. This token may be of any length.
* @return mixed Data from Google
public function search($query, $fields =
null, $language =
null, $max =
10, $order =
null, $token =
null)
// Check if fields is specified.
$url .=
'&fields=' .
$fields;
// Check if language is specified.
$url .=
'&language=' .
$language;
// Check if max is specified.
$url .=
'&maxResults=' .
$max;
// Check if order is specified.
$url .=
'&orderBy=' .
$order;
// Check of token is specified.
$url .=
'&pageToken=' .
$token;
$jdata =
$this->auth->query($url);
Documentation generated on Tue, 19 Nov 2013 14:53:22 +0100 by phpDocumentor 1.4.3