* @access public
* @static
*/
- static function retrieve( &$params, &$defaults ) {
- $financialTypeAccount = new CRM_Financial_DAO_EntityFinancialAccount( );
- $financialTypeAccount->copyValues( $params );
- if ( $financialTypeAccount->find( true ) ) {
- CRM_Core_DAO::storeValues( $financialTypeAccount, $defaults );
- return $financialTypeAccount;
+ static function retrieve(&$params, &$defaults, &$allValues = array()) {
+ $financialTypeAccount = new CRM_Financial_DAO_EntityFinancialAccount();
+ $financialTypeAccount->copyValues($params);
+ $financialTypeAccount->find();
+ while ($financialTypeAccount->fetch()) {
+ CRM_Core_DAO::storeValues($financialTypeAccount, $defaults);
+ $allValues[] = $defaults;
}
- return null;
+ return $defaults;
}
/**
$financialType[$dao->id] = array();
CRM_Core_DAO::storeValues( $dao, $financialType[$dao->id]);
$defaults = $financialAccountId = array();
- $financialAccounts = CRM_Contribute_PseudoConstant::financialAccount( );
- $financialAccountIds = CRM_Core_DAO::commonRetrieveAll( 'CRM_Financial_DAO_EntityFinancialAccount',
- 'entity_id', $dao->id, $defaults, array('financial_account_id'));
+ $financialAccounts = CRM_Contribute_PseudoConstant::financialAccount();
+ $financialAccountIds = array();
+
+ $params['entity_id'] = $dao->id;
+ $params['entity_table'] = 'civicrm_financial_type';
+ CRM_Financial_BAO_FinancialTypeAccount::retrieve($params, CRM_Core_DAO::$_nullArray, $financialAccountIds);
foreach( $financialAccountIds as $key => $values){
if (CRM_Utils_Array::value($values['financial_account_id'], $financialAccounts)) {