Beispiel #1
0
 /**
  * Delete the profile Group.
  *
  * @param int $id
  *   Profile Id.
  *
  * @return bool
  *
  */
 public static function del($id)
 {
     //check whether this group contains  any profile fields
     $profileField = new CRM_Core_DAO_UFField();
     $profileField->uf_group_id = $id;
     $profileField->find();
     while ($profileField->fetch()) {
         CRM_Core_BAO_UFField::del($profileField->id);
     }
     //delete records from uf join table
     $ufJoin = new CRM_Core_DAO_UFJoin();
     $ufJoin->uf_group_id = $id;
     $ufJoin->delete();
     //delete profile group
     $group = new CRM_Core_DAO_UFGroup();
     $group->id = $id;
     $group->delete();
     return 1;
 }