当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Mailing_Event_BAO_Subscribe::deleteGroup方法代码示例

本文整理汇总了PHP中CRM_Mailing_Event_BAO_Subscribe::deleteGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Mailing_Event_BAO_Subscribe::deleteGroup方法的具体用法?PHP CRM_Mailing_Event_BAO_Subscribe::deleteGroup怎么用?PHP CRM_Mailing_Event_BAO_Subscribe::deleteGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Mailing_Event_BAO_Subscribe的用法示例。


在下文中一共展示了CRM_Mailing_Event_BAO_Subscribe::deleteGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: discard

 /**
  * Function to delete the group and all the object that connect to
  * this group. Incredibly destructive
  *
  * @param int $id group id
  *
  * @return null
  * @access public
  * @static
  *
  */
 static function discard($id)
 {
     require_once 'CRM/Utils/Hook.php';
     require_once 'CRM/Contact/DAO/SubscriptionHistory.php';
     CRM_Utils_Hook::pre('delete', 'Group', $id, CRM_Core_DAO::$_nullArray);
     require_once 'CRM/Core/Transaction.php';
     $transaction = new CRM_Core_Transaction();
     // added for CRM-1631 and CRM-1794
     // delete all subscribed mails with the selected group id
     require_once 'CRM/Mailing/Event/BAO/Subscribe.php';
     $subscribe = new CRM_Mailing_Event_BAO_Subscribe();
     $subscribe->deleteGroup($id);
     // delete all Subscription  records with the selected group id
     $subHistory = new CRM_Contact_DAO_SubscriptionHistory();
     $subHistory->group_id = $id;
     $subHistory->delete();
     // delete all crm_group_contact records with the selected group id
     require_once 'CRM/Contact/DAO/GroupContact.php';
     $groupContact = new CRM_Contact_DAO_GroupContact();
     $groupContact->group_id = $id;
     $groupContact->delete();
     // make all the 'add_to_group_id' field of 'civicrm_uf_group table', pointing to this group, as null
     $params = array(1 => array($id, 'Integer'));
     $query = "update civicrm_uf_group SET `add_to_group_id`= NULL where `add_to_group_id` = %1";
     CRM_Core_DAO::executeQuery($query, $params);
     $query = "update civicrm_uf_group SET `limit_listings_group_id`= NULL where `limit_listings_group_id` = %1";
     CRM_Core_DAO::executeQuery($query, $params);
     if (defined('CIVICRM_MULTISITE') && CIVICRM_MULTISITE) {
         // clear any descendant groups cache if exists
         require_once 'CRM/Core/BAO/Cache.php';
         $finalGroups =& CRM_Core_BAO_Cache::deleteGroup('descendant groups for an org');
     }
     // delete from group table
     $group = new CRM_Contact_DAO_Group();
     $group->id = $id;
     $group->delete();
     $transaction->commit();
     CRM_Utils_Hook::post('delete', 'Group', $id, $group);
     // delete the recently created Group
     require_once 'CRM/Utils/Recent.php';
     $groupRecent = array('id' => $id, 'type' => 'Group');
     CRM_Utils_Recent::del($groupRecent);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:54,代码来源:Group.php


注:本文中的CRM_Mailing_Event_BAO_Subscribe::deleteGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。