Hi,

The following will add an email address to the entry. The idea is to
get the ExtensionElements array from the entry, add the new extension
and set the new array back to the entry.

  // gets the entry's exenstions elemensts array
  $extensionElements = $entry->getExtensionElements();

  // creates the new email extension element
  $extension = new Zend_Gdata_App_Extension_Element('email', null,
'http://schemas.google.com/g/2005');
  $attributes['address'] = array
('namespaceUri'=>null,'name'=>'address', 'value' =>
'[email protected]');
  $attributes['rel'] = array('namespaceUri'=>null,'name'=>'rel',
'value' => 'http://schemas.google.com/g/2005#home');
  $attributes['primary'] = array
('namespaceUri'=>null,'name'=>'primary', 'value' => 'false'); // only
one Primary email
  $extension->setExtensionAttributes($attributes);

  // adds the new email extension element to the entry's exenstions
elemensts array
  array_push( $extensionElements, $extension );
  $entry->setExtensionElements($extensionElements);
  $entry->save();

Cheers,
Julian.

On Mar 9, 1:52 pm, brian <[email protected]> wrote:
> Thanks, Andreroy55 .. unfortunately I was looking for a PHP/Zend
> snippet.  However, it has been useful to see the different ways to
> treat different data (phone, email, org, etc).  Can I use these
> newOrganization, newPhoneNumber and such in php/zend?  I haven't been
> able to, yet.
>
> Anyone else out there with a little help to offer?  Would WAY
> appreciate it, as I'm still stumped on this one.  Can only write to
> email and content fields successfully - not to title, org, ph, addy,
> etc.
>
> Thanks!
> Brian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to