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


PHP CRM_Financial_BAO_FinancialTypeAccount::del方法代碼示例

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


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

示例1: testDel

 /**
  * Check method del()
  */
 public function testDel()
 {
     list($financialAccount, $financialType, $financialAccountType) = $this->createFinancialAccount('Expenses', 'Expense Account is');
     CRM_Financial_BAO_FinancialTypeAccount::del($financialAccountType->id);
     $params = array('id' => $financialAccountType->id);
     $result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults);
     $this->assertEquals(empty($result), TRUE, 'Verify financial types record deletion.');
 }
開發者ID:nielosz,項目名稱:civicrm-core,代碼行數:11,代碼來源:FinancialTypeAccountTest.php

示例2: testDel

 /**
  * check method del()
  */
 function testDel()
 {
     $params = array('name' => 'TestFinancialAccount_2', 'is_deductible' => 0, 'is_active' => 1, 'is_reserved' => 0);
     $ids = array();
     $defaults = array();
     $financialAccount = CRM_Financial_BAO_FinancialAccount::add($params, $ids);
     $params['name'] = 'test_financialType2';
     $financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
     $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Expense Account is' "));
     $financialParams = array('entity_table' => 'civicrm_financial_type', 'entity_id' => $financialType->id, 'account_relationship' => $relationTypeId, 'financial_account_id' => $financialAccount->id);
     $financialAccountType = CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, $ids);
     CRM_Financial_BAO_FinancialTypeAccount::del($financialAccountType->id);
     $params = array('id' => $financialAccountType->id);
     $result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults);
     $this->assertEquals(empty($result), true, 'Verify financial types record deletion.');
 }
開發者ID:prashantgajare,項目名稱:civicrm-core,代碼行數:19,代碼來源:FinancialTypeAccountTest.php

示例3: postProcess

 /**
  * Function to process the form
  *
  * @access public
  * @return void
  */
 public function postProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         CRM_Financial_BAO_FinancialTypeAccount::del($this->_id, $this->_aid);
         CRM_Core_Session::setStatus(ts('Selected financial type account 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['entityFinancialAccount'] = $this->_id;
         }
         if ($this->_action & CRM_Core_Action::ADD || $this->_action & CRM_Core_Action::UPDATE) {
             $params['financial_account_id'] = $this->_submitValues['financial_account_id'];
         }
         $params['entity_table'] = 'civicrm_financial_type';
         if ($this->_action & CRM_Core_Action::ADD) {
             $params['entity_id'] = $this->_aid;
         }
         $financialTypeAccount = CRM_Financial_BAO_FinancialTypeAccount::add($params, $ids);
         CRM_Core_Session::setStatus(ts('The financial type Account has been saved.'));
     }
     $buttonName = $this->controller->getButtonName();
     $session = CRM_Core_Session::singleton();
     if ($buttonName == $this->getButtonName('next', 'new')) {
         CRM_Core_Session::setStatus(ts(' You can add another Financial Account Type.'));
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/financial/financialType/accounts', "reset=1&action=add&aid={$this->_aid}"));
     } else {
         $session->replaceUserContext(CRM_Utils_System::url('civicrm/admin/financial/financialType/accounts', "reset=1&action=browse&aid={$this->_aid}"));
     }
 }
開發者ID:archcidburnziso,項目名稱:civicrm-core,代碼行數:37,代碼來源:FinancialTypeAccount.php


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