當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Member_BAO_MembershipStatus::del方法代碼示例

本文整理匯總了PHP中CRM_Member_BAO_MembershipStatus::del方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Member_BAO_MembershipStatus::del方法的具體用法?PHP CRM_Member_BAO_MembershipStatus::del怎麽用?PHP CRM_Member_BAO_MembershipStatus::del使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Member_BAO_MembershipStatus的用法示例。


在下文中一共展示了CRM_Member_BAO_MembershipStatus::del方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testDel

 public function testDel()
 {
     $params = array('name' => 'testStatus', 'is_active' => 1);
     $membershipStatus = CRM_Member_BAO_MembershipStatus::add($params);
     CRM_Member_BAO_MembershipStatus::del($membershipStatus->id);
     $defaults = array();
     $result = CRM_Member_BAO_MembershipStatus::retrieve($params, $defaults);
     $this->assertEquals(empty($result), TRUE, 'Verify membership status record deletion.');
 }
開發者ID:rajeshrhino,項目名稱:civicrm-core,代碼行數:9,代碼來源:MembershipStatusTest.php

示例2: civicrm_api3_membership_status_delete

/**
 * Deletes an existing membership status
 *
 * This API is used for deleting a membership status
 *
 * @param  array  Params array containing 'id' -    Id of the membership status to be deleted
 * {@getfields MembershipStatus_delete}
 *
 * @return array i
 * @access public
 */
function civicrm_api3_membership_status_delete($params)
{
    $memberStatusDelete = CRM_Member_BAO_MembershipStatus::del($params['id'], TRUE);
    return $memberStatusDelete ? civicrm_api3_create_error($memberStatusDelete['error_message']) : civicrm_api3_create_success();
}
開發者ID:peteainsworth,項目名稱:civicrm-4.2.9-drupal,代碼行數:16,代碼來源:MembershipStatus.php

示例3: postProcess

 /**
  * Function to process the form
  *
  * @access public
  *
  * @return void
  */
 public function postProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         try {
             CRM_Member_BAO_MembershipStatus::del($this->_id);
         } catch (CRM_Core_Exception $e) {
             CRM_Core_Error::statusBounce($e->getMessage(), NULL, ts('Delete Failed'));
         }
         CRM_Core_Session::setStatus(ts('Selected membership status has been deleted.'), ts('Record Deleted'), 'success');
     } else {
         $params = $ids = array();
         // store the submitted values in an array
         $params = $this->exportValues();
         if ($this->_action & CRM_Core_Action::UPDATE) {
             $ids['membershipStatus'] = $this->_id;
         }
         $oldWeight = NULL;
         if ($this->_id) {
             $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $this->_id, 'weight', 'id');
         }
         $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Member_DAO_MembershipStatus', $oldWeight, $params['weight']);
         // only for add mode, set label to name.
         if ($this->_action & CRM_Core_Action::ADD) {
             $params['name'] = $params['label'];
         }
         $membershipStatus = CRM_Member_BAO_MembershipStatus::add($params, $ids);
         CRM_Core_Session::setStatus(ts('The membership status \'%1\' has been saved.', array(1 => $membershipStatus->label)), ts('Saved'), 'success');
     }
 }
開發者ID:archcidburnziso,項目名稱:civicrm-core,代碼行數:36,代碼來源:MembershipStatus.php

示例4: civicrm_membership_status_delete

/**
 * Deletes an existing membership status
 * 
 * This API is used for deleting a membership status
 * 
 * @param  Int  $membershipStatusID   Id of the membership status to be deleted
 * 
 * @return null if successfull, object of CRM_Core_Error otherwise
 * @access public
 */
function civicrm_membership_status_delete(&$params)
{
    if (!is_array($params)) {
        return civicrm_create_error('Params is not an array');
    }
    if (!CRM_Utils_Array::value('id', $params)) {
        return civicrm_create_error('Invalid or no value for membershipStatusID');
    }
    require_once 'CRM/Member/BAO/MembershipStatus.php';
    $memberStatusDelete = CRM_Member_BAO_MembershipStatus::del($params['id']);
    return $memberStatusDelete ? civicrm_create_error('Error while deleting membership type Status') : civicrm_create_success();
}
開發者ID:ksecor,項目名稱:civicrm,代碼行數:22,代碼來源:MembershipStatus.php

示例5: _crm_initialize

/**
 * Deletes an existing membership status
 * 
 * This API is used for deleting a membership status
 * 
 * @param  Int  $membershipStatusID   Id of the membership status to be deleted
 * 
 * @return null if successfull, object of CRM_Core_Error otherwise
 * @access public
 */
function &crm_delete_membership_status($membershipStatusID)
{
    _crm_initialize();
    if (empty($membershipStatusID)) {
        return _crm_error('Invalid value for membershipStatusID');
    }
    require_once 'CRM/Member/BAO/MembershipStatus.php';
    CRM_Member_BAO_MembershipStatus::del($membershipStatusID);
}
開發者ID:bhirsch,項目名稱:voipdev,代碼行數:19,代碼來源:Membership.php

示例6: postProcess

 /**
  * Function to process the form
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     require_once 'CRM/Member/BAO/MembershipStatus.php';
     if ($this->_action & CRM_Core_Action::DELETE) {
         $wt = CRM_Utils_Weight::delWeight('CRM_Member_DAO_MembershipStatus', $this->_id);
         CRM_Member_BAO_MembershipStatus::del($this->_id);
         CRM_Core_Session::setStatus(ts('Selected membership status has been deleted.'));
     } else {
         $params = $ids = array();
         // store the submitted values in an array
         $params = $this->exportValues();
         if ($this->_action & CRM_Core_Action::UPDATE) {
             $ids['membershipStatus'] = $this->_id;
         }
         if ($this->_id) {
             $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $this->_id, 'weight', 'id');
         }
         $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Member_DAO_MembershipStatus', $oldWeight, $params['weight']);
         // only for add mode, set label to name.
         if ($this->_action & CRM_Core_Action::ADD) {
             $params['name'] = $params['label'];
         }
         $membershipStatus = CRM_Member_BAO_MembershipStatus::add($params, $ids);
         CRM_Core_Session::setStatus(ts('The membership status \'%1\' has been saved.', array(1 => $membershipStatus->label)));
     }
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:32,代碼來源:MembershipStatus.php

示例7: civicrm_api3_membership_status_delete

/**
 * Deletes an existing membership status.
 *
 * This API is used for deleting a membership status
 *
 * @param array $params
 *
 * @return array
 */
function civicrm_api3_membership_status_delete($params)
{
    $memberStatusDelete = CRM_Member_BAO_MembershipStatus::del($params['id'], TRUE);
    if ($memberStatusDelete) {
        throw new API_Exception($memberStatusDelete['error_message']);
    }
    return civicrm_api3_create_success();
}
開發者ID:nielosz,項目名稱:civicrm-core,代碼行數:17,代碼來源:MembershipStatus.php


注:本文中的CRM_Member_BAO_MembershipStatus::del方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。