-
Notifications
You must be signed in to change notification settings - Fork 1
Class GContacts
Full name: \SKien\Google\GContacts
See Also:
| Constant | Description |
|---|---|
CONTACTS |
valid scopes to retrieve person data |
CONTACTS_READONLY |
|
CONTACTS_OTHER_READONLY |
|
SO_LAST_MODIFIED_ASCENDING |
Sort people by when they were changed; older entries first. |
SO_LAST_MODIFIED_DESCENDING |
Sort people by when they were changed; newer entries first. |
SO_FIRST_NAME_ASCENDING |
Sort people by first name. |
SO_LAST_NAME_ASCENDING |
Sort people by last name. |
DEF_DETAIL_PERSON_FIELDS |
the default personFields for detail view |
DEF_LIST_PERSON_FIELDS |
the default personFields for detail view |
| Method | Description |
|---|---|
| __construct | Create instance an pass the clinet for the requests. |
| addPersonFields | Add personFields/readMask for next request. |
| createContact | Creates a new contact. |
| deleteContact | Delete the requested contact. |
| deleteContactPhoto | Delete contact photo for given contact. |
| getContact | Get the contact specified by its resourceName. |
| list | Get the whole contact list. |
| search | Search within the contacts. |
| setContactPhoto | Set contact photo from base64 encoded image data. |
| setContactPhotoFile | Set contact photo from image file. |
| setContactStarred | Set or unset the 'starred' mark for the specified contact. |
| setPageSize | Set the pagesize for reading lists. |
| updateContact | Updates an existing contact specified by resourceName. |
Create instance an pass the clinet for the requests.
public GContacts::__construct(\SKien\Google\GClient $oClient)Parameters:
| Parameter | Type | Description |
|---|---|---|
oClient |
\SKien\Google\GClient |
Add personFields/readMask for next request.
public GContacts::addPersonFields(mixed $fields) : voidCan be called multiple and/or by passing an array of personFields. All const GContact::PF_xxxx can be specified.
Parameters:
| Parameter | Type | Description |
|---|---|---|
fields |
mixed |
Creates a new contact.
public GContacts::createContact(\SKien\Google\GContact $oContact) : \SKien\Google\GContact|falseParameters:
| Parameter | Type | Description |
|---|---|---|
oContact |
\SKien\Google\GContact |
Return Type: \SKien\Google\GContact|false
See Also:
Delete the requested contact.
public GContacts::deleteContact(string $strResourceName) : boolParameters:
| Parameter | Type | Description |
|---|---|---|
strResourceName |
string |
Return Type: bool
See Also:
Delete contact photo for given contact.
public GContacts::deleteContactPhoto(string $strResourceName) : boolParameters:
| Parameter | Type | Description |
|---|---|---|
strResourceName |
string |
Return Type: bool
See Also:
Get the contact specified by its resourceName.
public GContacts::getContact(string $strResourceName) : \SKien\Google\GContact|falsehttps://developers.google.com/people/api/rest/v1/people/get
Parameters:
| Parameter | Type | Description |
|---|---|---|
strResourceName |
string |
Return Type: \SKien\Google\GContact|false
Get the whole contact list.
public GContacts::list(string $strSortOrder = self::SO_LAST_NAME_ASCENDING, string $strGroupResourceName = '') : array|falseParameters:
| Parameter | Type | Description |
|---|---|---|
strSortOrder |
string | one of the self::SO_xxx constants |
strGroupResourceName |
string |
Return Type: array|false
See Also:
Search within the contacts.
public GContacts::search(string $strQuery) : array|falseNote: The count of contacts, the search request returns is limitetd to the pageSize (which is limited itself to max. 30 at all). If there are more contacts in the list that matches the query, unfortunately NO further information aboutthat additional contacts - and how many - are available!
Parameters:
| Parameter | Type | Description |
|---|---|---|
strQuery |
string |
Return Type: array|false
See Also:
Set contact photo from base64 encoded image data.
public GContacts::setContactPhoto(string $strResourceName, string $blobPhoto) : boolParameters:
| Parameter | Type | Description |
|---|---|---|
strResourceName |
string | |
blobPhoto |
string | base64 encoded image |
Return Type: bool
See Also:
Set contact photo from image file.
public GContacts::setContactPhotoFile(string $strResourceName, string $strFilename) : boolSupported types are JPG, PNG, GIF and BMP.
Parameters:
| Parameter | Type | Description |
|---|---|---|
strResourceName |
string | |
strFilename |
string |
Return Type: bool
See Also:
Set or unset the 'starred' mark for the specified contact.
public GContacts::setContactStarred(string $strResourceName, bool $bSetStarred = true) : boolThe 'starred' mark just means, the contact belongs to the system group contactGroups/starred.
Parameters:
| Parameter | Type | Description |
|---|---|---|
strResourceName |
string | |
bSetStarred |
bool |
Return Type: bool
See Also:
- \SKien\Google\GContactGroups::addContactsToGroup()
- \SKien\Google\GContactGroups::removeContactsFromGroup()
Set the pagesize for reading lists.
public GContacts::setPageSize(int $iPageSize) : voidMay be limited to the max. pgaesize for the request.
- contact list: max. pagesize is 1000
- search: max. pagesize is 30
Parameters:
| Parameter | Type | Description |
|---|---|---|
iPageSize |
int |
Updates an existing contact specified by resourceName.
public GContacts::updateContact(string $strResourceName, \SKien\Google\GContact $oContact) : \SKien\Google\GContact|falseTo prevent the user from data loss, this request fails with an 400 response code, if the contact has changed on the server, since it was loaded. Reload the data from the server and make the changes again!
Parameters:
| Parameter | Type | Description |
|---|---|---|
strResourceName |
string | |
oContact |
\SKien\Google\GContact |
Return Type: \SKien\Google\GContact|false
See Also:
build with phpDocumentor 3 using template phpdoc2githubwiki / (2023-04-26)