|
Google Shared Contacts Manager
1.0
Semestral project for BI-ZNF
|
Class provides CRUD functionality for Contacts. More...
Public Member Functions | |
| __construct (APIService $apis, OAuthService $oa, User $user) | |
| ContactService constructor. More... | |
| get ($id, $purge=false) | |
| Get single contact. More... | |
| getAll ($filter, $order, $purge=false) | |
| Get filtered & ordered list of contacts. More... | |
| create (Contact $c) | |
| Save new contact to Google Contacts. More... | |
| update (Contact $cn) | |
| Update the contact in Google Contacts. More... | |
| delete (Contact $cn, $recache=true) | |
| Delete the contact from Google Contacts. More... | |
| deleteBatch (array $ids) | |
| Delete a group of contacts from Google Contacts. More... | |
| saveProfilePhoto (Contact $c, SerializableImage $img) | |
| Save uploaded image as Contact's profile photo and send it to Google Contacts. More... | |
| getDomain () | |
| Get domain of currently logged in administrator. More... | |
| getBaseTarget () | |
| Get URL that is target for most of the requests. More... | |
Data Fields | |
| const | XMLNS_ATOM = "http://www.w3.org/2005/Atom" |
| const | XMLNS_GD = "http://schemas.google.com/g/2005" |
| const | XML_SCHEMA = "http://schemas.google.com/g/2005#kind" |
| const | XML_TERM = "http://schemas.google.com/contact/2008#contact" |
| const | DEFAULT_CONTACT_DESCRIPTION = "Domain Shared Contact created with http://gshared-contacts.appspot.com/" |
| const | CACHE_EXPIRATION = "10 minutes" |
Private Member Functions | |
| getNewPhotoURL (\SimpleXMLElement &$xml) | |
| Get target url for profile photo upload from the XML response. More... | |
| singleContactFromXML (\SimpleXMLElement &$xml) | |
| Parse XML response as a single contact. More... | |
| parseContact (\SimpleXMLElement &$xc, Contact &$c) | |
| Parse contact attributes to contact object representation. More... | |
| contactToXML (Contact &$contact) | |
| Convert contact to XML. More... | |
| setPhoto (\SimpleXMLElement &$xc, Contact &$c) | |
| Parse contact and get its profile photo. More... | |
| getProfilePhoto ($target) | |
| Receive profile photo from Google. More... | |
| prepareContacts ($filter, $order, &$contacts) | |
| Filter & order the list of contacts according to criteria. More... | |
| filterContacts (array $filters, &$contacts) | |
| Apply filters to the list of Contacts. More... | |
| isMatch (Contact $c, array &$f) | |
| Determine whether the contact matches filter criteria or not. More... | |
| isEmailMatch ($emails, $query) | |
| Determine whether any of the emails match the filter criteria. More... | |
| isPhoneMatch ($phones, $query) | |
| Determine whether any of the phone numbers match the filter criteria. More... | |
Private Attributes | |
| $apis | |
| $oauth | |
| $cache | |
| $user | |
Class provides CRUD functionality for Contacts.
| __construct | ( | APIService | $apis, |
| OAuthService | $oa, | ||
| User | $user | ||
| ) |
ContactService constructor.
| APIService | $apis | |
| OAuthService | $oa | |
| User | $user |
|
private |
| delete | ( | Contact | $cn, |
$recache = true |
|||
| ) |
Delete the contact from Google Contacts.
| Contact | $cn | |
| bool | $recache | Whether removed contact should be removed from cache |
| deleteBatch | ( | array | $ids | ) |
Delete a group of contacts from Google Contacts.
| array | $ids |
|
private |
Apply filters to the list of Contacts.
| array | $filters | |
| Contact[] | $contacts |
| get | ( | $id, | |
$purge = false |
|||
| ) |
Get single contact.
| string | $id | ID of an existing Contact |
| bool | $purge | Whether cache should be updated |
| getAll | ( | $filter, | |
| $order, | |||
$purge = false |
|||
| ) |
Get filtered & ordered list of contacts.
| array | $filter | Rules to filter the contacts |
| array | $order | Rules to order the contacts |
| bool | $purge | Whether cache should be updated |
| getBaseTarget | ( | ) |
Get URL that is target for most of the requests.
| getDomain | ( | ) |
Get domain of currently logged in administrator.
|
private |
Get target url for profile photo upload from the XML response.
| \SimpleXMLElement | $xml |
|
private |
|
private |
Determine whether any of the emails match the filter criteria.
| EmailAttribute[] | $emails | |
| string | $query |
|
private |
Determine whether the contact matches filter criteria or not.
| Contact | $c | |
| array | $f |
|
private |
Determine whether any of the phone numbers match the filter criteria.
| PhoneAttribute[] | $phones | |
| string | $query |
|
private |
Parse contact attributes to contact object representation.
| \SimpleXMLElement | $xc | |
| Contact | $c |
|
private |
Filter & order the list of contacts according to criteria.
| array | $filter | Filter rules |
| array | $order | Order rule |
| Contact[] | $contacts |
| saveProfilePhoto | ( | Contact | $c, |
| SerializableImage | $img | ||
| ) |
Save uploaded image as Contact's profile photo and send it to Google Contacts.
| Contact | $c | |
| SerializableImage | $img |
|
private |
Parse contact and get its profile photo.
| \SimpleXMLElement | $xc | |
| Contact | $c |
|
private |
|
private |
|
private |
|
private |
|
private |
| const CACHE_EXPIRATION = "10 minutes" |
| const DEFAULT_CONTACT_DESCRIPTION = "Domain Shared Contact created with http://gshared-contacts.appspot.com/" |
| const XML_SCHEMA = "http://schemas.google.com/g/2005#kind" |
| const XML_TERM = "http://schemas.google.com/contact/2008#contact" |
| const XMLNS_ATOM = "http://www.w3.org/2005/Atom" |
| const XMLNS_GD = "http://schemas.google.com/g/2005" |