-
Notifications
You must be signed in to change notification settings - Fork 7
Using Google Contacts
imekinox edited this page Sep 13, 2010
·
2 revisions
var $google_contacts = array(
'datasource' => 'google_contacts',
'accounttype' => 'GOOGLE',
'email' => 'YOUR GOOGLE EMAIL',
'passwd' => 'YOUR PASSWORD',
'source' => 'companyName-applicationName-versionID',
'database' => ''
);
- all
- count
- first
Default limit is 25 use limit for override.
- start-index → For paging
- updated-min → The lower bound on entry update dates.
- orderby → Sorting criterion. The only supported value is lastmodified.
- showdeleted → Include deleted contacts in the returned contacts feed.
- group → Value of this parameter specifies group ID
Use debug($this→GoogleContacts→_schema); to get structured array
class GoogleContactsController extends AppController
{
var $name = 'GoogleContacts';
var $uses = array( 'GoogleContacts' , 'Users' );
function testFindById(){
$contact = $this->GoogleContacts->find('first');
$res = $this->GoogleContacts->findById($contact['id']);
debug($res);
die();
}
function testFindAllLimit5(){
$contact = $this->GoogleContacts->find('all', array('limit'=>5));
debug($contact);
die();
}
function testFindAll(){
$contact = $this->GoogleContacts->find('all');
debug($contact);
die();
}
function testCount(){
$contact = $this->GoogleContacts->find('count');
debug($contact);
die();
}
function testFindFirst(){
$contact = $this->GoogleContacts->find('first');
debug($contact);
die();
}
function testUpdate() {
$contact = $this->GoogleContacts->find('first');
$contact['Name']['fullName'] = "Contact Changed From Cake";
$this->GoogleContacts->create($contact);
$r = $this->GoogleContacts->save();
debug($r);
die();
}
}