/** * Delete all records for this contact id. * * @param int $id * ID of the contact for which note needs to be deleted. */ public static function deleteContact($id) { // need to delete for both entity_id $dao = new CRM_Core_DAO_Note(); $dao->entity_table = 'civicrm_contact'; $dao->entity_id = $id; $dao->delete(); // and the creator contact id $dao = new CRM_Core_DAO_Note(); $dao->contact_id = $id; $dao->delete(); }