Hey there, thanks for the quick response, ive tested the code but it
doesnt work! i got the main idea of how it works, but if i put echo
'something'; inside foreach ( $entry->getExtensionElements() as
$extensionElement ) , the echo doesnt get displayed, that means the
code doesnt get executed in that foreach.

Let me know if i do a mistake.
Thanks

On Mar 30, 5:19 pm, "Julian (Google)" <[email protected]> wrote:
> Hi,
>
> You can remove the appropriate Extension Element for the Entry, for
> example the following code iterates over all Entries and removes them
> from one Group:
>
> $client = Zend_Gdata_ClientLogin::getHttpClient("[email protected]",
> "PASWORD", "cp");
> $gdata = new Zend_Gdata($client);
> $query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/
> user%40domain.com/full');
> $query->setMaxResults(1000);
> $feed = $gdata->getFeed($query,Zend_Gdata_App_Feed);
>
> // Group ID to Remove:
> $groupId = 'http://www.google.com/m8/feeds/groups/user%40domain.com/
> base/7d60cf6309868fc6';
>
> foreach ($feed->getEntry() as $entry ) {
>   $newExtensionElements = array();
>   foreach ( $entry->getExtensionElements() as $extensionElement ) {
>     $domElement = $extensionElement->getDom();
>     if ( !($domElement->tagName == 'groupMembershipInfo' and
> $domElement->getAttribute( 'href' ) == $groupId )) {
>       array_push($newExtensionElements, $extensionElement );
>     }
>   }
>   #print_r( $newExtensionElements );
>   $entry->setExtensionElements( $newExtensionElements );
>   $entry->save();
>
> }
>
> You can find more information about Gdata_App_Base and
> Gdata_App_Extension_Element in the following 
> links:http://framework.zend.com/apidoc/core/Zend_Gdata/App/Zend_Gdata_App_B...http://framework.zend.com/apidoc/core/Zend_Gdata/App/Zend_Gdata_App_E...
>
> Cheers,
> Julian.
>
> On Mar 28, 11:57 pm, darie nicolae <[email protected]> wrote:
>
> > Hello,
>
> > My question is how do i delete a contact from a group, through PHP?
>
> > Thanks.
>
> On Mar 28, 11:57 pm, darie nicolae <[email protected]> wrote:
>
> > Hello,
>
> > My question is how do i delete a contact from a group, through PHP?
>
> > Thanks.
--~--~---------~--~----~------------~-------~--~----~
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