我有一個使用zend_gdata的應用程序並使用下面的代碼創建聯繫人。使用Zend_GData和Google Contacts API將聯繫人添加到組中
$doc = new DOMDocument();
$doc->formatOutput = true;
$entry = $doc->createElement('atom:entry');
$entry->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:atom', 'http://www.w3.org/2005/Atom');
$entry->setAttributeNS('http://www.w3.org/2000/xmlns/' , 'xmlns:gd', 'http://schemas.google.com/g/2005');
$doc->appendChild($entry);
// add name element
$name = $doc->createElement('gd:name');
$entry->appendChild($name);
$fullName = $doc->createElement('gd:fullName', htmlentities($data->firstname . ' ' . $data->lastname));
$name->appendChild($fullName);
// insert entry
$entryResult = $gdata->insertEntry($doc->saveXML(), 'http://www.google.com/m8/feeds/contacts/default/full');
是否有可能將函數添加到剛創建的聯繫人中?
你是什麼意思的「添加一組到聯繫人」?是「將聯繫人添加到羣組」嗎? – emaillenin 2011-05-26 07:50:20