Well ... I'm stuck again ...
Here's the piece of code that used to work prior to V2.0:
public function search_group_contacts_tb($param){
$params = array( 'title' => $param );
$return_properties = array('title' );
$myGroups =& crm_get_groups($params, $return_properties);
foreach($myGroups as $group) {
$return_properties = array( 'email' );
$sort = array("email" => "ASC");
$myContacts =& crm_get_group_contacts(&$group, $return_propertie
s ,'Added',$sort, $offset = 0, $row_count = null );
foreach ($myContacts as $contact) {
$display .= $contact->email . ", ";
}
}
return $display;
}
The crm_get_group_contact API seems not to be available anymore. So is the 'crm_get_group'. I managed to adapt the latter with the 'civicrm_groups_get' V2 API but I can't find an alternative to the first one.
The bottom line is how do I retrieve the email address from a group? civicrm_contact_search() isn't helpful since the ERD shows the groups a contact belongs to is only available through the civicrm_group_contact table. Therefore I don't see what parameter I could pass to civicrm_contact_search().