本文整理汇总了PHP中CRM_Financial_BAO_FinancialType::retrieve方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Financial_BAO_FinancialType::retrieve方法的具体用法?PHP CRM_Financial_BAO_FinancialType::retrieve怎么用?PHP CRM_Financial_BAO_FinancialType::retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Financial_BAO_FinancialType
的用法示例。
在下文中一共展示了CRM_Financial_BAO_FinancialType::retrieve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.');
}
示例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.');
}
示例3: testGetContributionLegacyBehaviour
/**
* We need to ensure previous tested behaviour still works as part of the api contract.
*/
public function testGetContributionLegacyBehaviour()
{
$p = array('contact_id' => $this->_individualId, 'receive_date' => '2010-01-20', 'total_amount' => 100.0, 'contribution_type_id' => $this->_financialTypeId, 'non_deductible_amount' => 10.0, 'fee_amount' => 5.0, 'net_amount' => 95.0, 'trxn_id' => 23456, 'invoice_id' => 78910, 'source' => 'SSF', 'contribution_status_id' => 1);
$this->_contribution = $this->callAPISuccess('Contribution', 'create', $p);
$params = array('contribution_id' => $this->_contribution['id']);
$contribution = $this->callAPIAndDocument('contribution', 'get', $params, __FUNCTION__, __FILE__);
$financialParams['id'] = $this->_financialTypeId;
$default = NULL;
CRM_Financial_BAO_FinancialType::retrieve($financialParams, $default);
$this->assertEquals(1, $contribution['count']);
$this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
$this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->_financialTypeId);
$this->assertEquals($contribution['values'][$contribution['id']]['contribution_type_id'], $this->_financialTypeId);
$this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.0);
$this->assertEquals($contribution['values'][$contribution['id']]['non_deductible_amount'], 10.0);
$this->assertEquals($contribution['values'][$contribution['id']]['fee_amount'], 5.0);
$this->assertEquals($contribution['values'][$contribution['id']]['net_amount'], 95.0);
$this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 23456);
$this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 78910);
$this->assertEquals($contribution['values'][$contribution['id']]['contribution_source'], 'SSF');
$this->assertEquals($contribution['values'][$contribution['id']]['contribution_status'], 'Completed');
// Create a second contribution - we are testing that 'id' gets the right contribution id (not the contact id).
$p['trxn_id'] = '3847';
$p['invoice_id'] = '3847';
$contribution2 = $this->callAPISuccess('contribution', 'create', $p);
// now we have 2 - test getcount
$contribution = $this->callAPISuccess('contribution', 'getcount', array());
$this->assertEquals(2, $contribution);
//test id only format
$contribution = $this->callAPISuccess('contribution', 'get', array('id' => $this->_contribution['id'], 'format.only_id' => 1));
$this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution, TRUE));
//test id only format
$contribution = $this->callAPISuccess('contribution', 'get', array('id' => $contribution2['id'], 'format.only_id' => 1));
$this->assertEquals($contribution2['id'], $contribution);
$contribution = $this->callAPISuccess('contribution', 'get', array('id' => $this->_contribution['id']));
//test id as field
$this->assertEquals(1, $contribution['count']);
// $this->assertEquals($this->_contribution['id'], $contribution['id'] ) ;
//test get by contact id works
$contribution = $this->callAPISuccess('contribution', 'get', array('contact_id' => $this->_individualId));
$this->assertEquals(2, $contribution['count']);
$this->callAPISuccess('Contribution', 'Delete', array('id' => $this->_contribution['id']));
$this->callAPISuccess('Contribution', 'Delete', array('id' => $contribution2['id']));
}
示例4: testdel
/**
* Check method del()
*/
public function testdel()
{
$params = array('name' => 'Donations', 'is_deductible' => 0, 'is_active' => 1);
$ids = array();
$contributionType = CRM_Financial_BAO_FinancialType::add($params, $ids);
CRM_Financial_BAO_FinancialType::del($contributionType->id);
$params = array('id' => $contributionType->id);
$result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults);
$this->assertEquals(empty($result), TRUE, 'Verify financial types record deletion.');
}