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


PHP CRM_Member_PseudoConstant::flush方法代码示例

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


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

示例1: del

 /**
  * Delete membership Types.
  *
  * @param int $membershipStatusId
  *
  * @throws CRM_Core_Exception
  */
 public static function del($membershipStatusId)
 {
     //check dependencies
     //checking if membership status is present in some other table
     $check = FALSE;
     $dependency = array('Membership', 'MembershipLog');
     foreach ($dependency as $name) {
         $baoString = 'CRM_Member_BAO_' . $name;
         $dao = new $baoString();
         $dao->status_id = $membershipStatusId;
         if ($dao->find(TRUE)) {
             throw new CRM_Core_Exception(ts('This membership status cannot be deleted as memberships exist with this status'));
         }
     }
     CRM_Utils_Weight::delWeight('CRM_Member_DAO_MembershipStatus', $membershipStatusId);
     //delete from membership Type table
     $membershipStatus = new CRM_Member_DAO_MembershipStatus();
     $membershipStatus->id = $membershipStatusId;
     $membershipStatus->delete();
     CRM_Member_PseudoConstant::flush('membershipStatus');
     $membershipStatus->free();
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:29,代码来源:MembershipStatus.php

示例2: membershipStatusCreate

 /**
  * @param string $name
  *
  * @return mixed
  */
 public function membershipStatusCreate($name = 'test member status')
 {
     $params['name'] = $name;
     $params['start_event'] = 'start_date';
     $params['end_event'] = 'end_date';
     $params['is_current_member'] = 1;
     $params['is_active'] = 1;
     $result = $this->callAPISuccess('MembershipStatus', 'Create', $params);
     CRM_Member_PseudoConstant::flush('membershipStatus');
     return $result['id'];
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:16,代码来源:CiviUnitTestCase.php


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