Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Service class for interacting with the Google Health Data API
AUTHSUB_PROFILE_FEED_URI
= 'https://www.google.com/health/feeds/profile/default'
URIs of the AuthSub/OAuth feeds.
CLIENTLOGIN_PROFILELIST_FEED_URI
= 'https://www.google.com/health/feeds/profile/list'
URIs of the ClientLogin feeds.

string
$_profileID= 'null'
Profile ID used for all API interactions. This can only be set when using ClientLogin for authentication.
null
Details
bool
$_useH9Sandbox= 'false'
True if API calls should be made to the H9 developer sandbox at /h9 rather than /health
false
Details
__construct(
\Zend_Http_Client $client
=
null, string $applicationId
=
'MyCompany-MyApp-1.0', bool $useH9Sandbox
=
false
)
:
void
Create Zend_Gdata_Health object
Name | Type | Description |
---|---|---|
$client | \Zend_Http_Client | (optional) The HTTP client to use when when communicating with the Google Health servers. |
$applicationId | string | The identity of the application in the form of Company-AppName-Version |
$useH9Sandbox | bool | True if the H9 Developer's Sandbox should be used instead of production Google Health. |

getHealthProfileEntry(
mixed $query
=
null
)
:
\Zend_Gdata_Health_ProfileEntry
Retrieve a profile entry object
Name | Type | Description |
---|---|---|
$query | mixed | The query for the feed, as a URL or Query |
Type | Description |
---|---|
\Zend_Gdata_Health_ProfileEntry |

getHealthProfileFeed(
mixed $query
=
null
)
:
\Zend_Gdata_Health_ProfileFeed
Retrieve a user's profile as a feed object. If ClientLogin is used, the profile associated with $this->_profileID is returned, otherwise the profile associated with the AuthSub token is read.
Name | Type | Description |
---|---|---|
$query | mixed | The query for the feed, as a URL or Query |
Type | Description |
---|---|
\Zend_Gdata_Health_ProfileFeed |

getHealthProfileListFeed(
string $query
=
null
)
:
\Zend_Gdata_Feed
Retrieves the list of profiles associated with the user's ClientLogin credentials.
Name | Type | Description |
---|---|---|
$query | string | The query of the feed as a URL or Query object |
Type | Description |
---|---|
\Zend_Gdata_Feed |

getProfileID(
)
:
string
Gets the id of the user's profile
Type | Description |
---|---|
string | The profile id |

sendHealthNotice(
string $subject, string $body, string $bodyType
=
null, string $ccrXML
=
null
)
:
\Zend_Gdata_Health_ProfileEntry
Posts a new notice using the register feed. This function constructs the atom profile entry.
Name | Type | Description |
---|---|---|
$subject | string | The subject line of the notice |
$body | string | The message body of the notice |
$bodyType | string | The (optional) type of message body (text, xhtml, html, etc.) |
$ccrXML | string | The (optional) CCR to add to the user's profile |
Type | Description |
---|---|
\Zend_Gdata_Health_ProfileEntry |

setProfileID(
string $id
)
:
\Zend_Gdata_Health
Sets which of the user's profiles will be used
Name | Type | Description |
---|---|---|
$id | string | The profile ID |
Type | Description |
---|---|
\Zend_Gdata_Health | Provides a fluent interface |