class Contacts_Photos extends Resource

Contacts photos resource

Properties

protected Service $_service Service object which owns this resource from Resource

Methods

mixed
__get(string $k)

Magic method to read properties

__set(string $k, string $v)

Magic method to forbid write access to properties

__construct(Service $service)

Constructor of service resource

from Resource
get(string $photolink)

Get contact photo

bool
update(Photo $photo, $photolink, $etag = '*')

Update/create a photo

bool
delete(string $photolink, string $etag = '*')

Delete a contact photo

Details

in MiscObject at line 28
mixed __get(string $k)

Magic method to read properties

Parameters

string $k Property name

Return Value

mixed

Exceptions

Exception Thrown if property $k does not exist in object

in MiscObject at line 44
__set(string $k, string $v)

Magic method to forbid write access to properties

Parameters

string $k Property name
string $v Property value

Exceptions

Exception Always thrown since we don't allow write access

in Resource at line 37
__construct(Service $service)

Constructor of service resource

Parameters

Service $service Service object which owns this resource

at line 28
Photo get(string $photolink)

Get contact photo

Parameters

string $photolink Link of contact photo to get (see $contact->links and fetch the link whose REL attribute equals to 'http://schemas.google.com/contacts/2008/rel#photo')

Return Value

Photo Returns a Photo object (containing body and contentType properties)

Exceptions

Google_Service_Exception Thrown if an error occured during the request

at line 49
bool update(Photo $photo, $photolink, $etag = '*')

Update/create a photo

Parameters

Photo $photo
$photolink
$etag

Return Value

bool Returns true when the upload is finished

Exceptions

Google_Service_Exception Thrown if an error occured during the request

at line 84
bool delete(string $photolink, string $etag = '*')

Delete a contact photo

Parameters

string $photolink Photo link of contact to delete (see $contact->links and fetch the link whose REL attribute equals to 'http://schemas.google.com/contacts/2008/rel#photo')
string $etag Etag property of contact with photo to delete, as read in the photo link etag property ; to omit this security feature, pass '*' as $etag value

Return Value

bool Always returns True, as if some error occurs, an exception is thrown

Exceptions

Google_Service_Exception Thrown if an error occured during the request