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


PHP CRM_Financial_DAO_FinancialType::save方法代码示例

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


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

示例1: add

 /**
  * function to add the financial types
  *
  * @param array $params reference array contains the values submitted by the form
  * @param array $ids    reference array contains the id
  *
  * @access public
  * @static
  * @return object
  */
 static function add(&$params, &$ids)
 {
     $params['is_active'] = CRM_Utils_Array::value('is_active', $params, false);
     $params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, false);
     $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, false);
     // action is taken depending upon the mode
     $financialType = new CRM_Financial_DAO_FinancialType();
     $financialType->copyValues($params);
     if (CRM_Utils_Array::value('financialType', $ids)) {
         $financialType->id = CRM_Utils_Array::value('financialType', $ids);
     }
     $financialType->save();
     // CRM-12470
     if (!CRM_Utils_Array::value('financialType', $ids)) {
         $titles = CRM_Financial_BAO_FinancialTypeAccount::createDefaultFinancialAccounts($financialType);
         $financialType->titles = $titles;
     }
     return $financialType;
 }
开发者ID:hguru,项目名称:224Civi,代码行数:29,代码来源:FinancialType.php

示例2: add

 /**
  * Add the financial types.
  *
  * @param array $params
  *   Reference array contains the values submitted by the form.
  * @param array $ids
  *   Reference array contains the id.
  *
  * @return object
  */
 public static function add(&$params, &$ids = array())
 {
     if (empty($params['id'])) {
         $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
         $params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, FALSE);
         $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
     }
     // action is taken depending upon the mode
     $financialType = new CRM_Financial_DAO_FinancialType();
     $financialType->copyValues($params);
     if (!empty($ids['financialType'])) {
         $financialType->id = CRM_Utils_Array::value('financialType', $ids);
         if (self::isACLFinancialTypeStatus()) {
             $prevName = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $financialType->id, 'name');
             if ($prevName != $params['name']) {
                 CRM_Core_Session::setStatus(ts("Changing the name of a Financial Type will result in losing the current permissions associated with that Financial Type.\n            Before making this change you should likely note the existing permissions at Administer > Users and Permissions > Permissions (Access Control),\n            then clicking the Access Control link for your Content Management System, then noting down the permissions for 'CiviCRM: {financial type name} view', etc.\n            Then after making the change of name, reset the permissions to the way they were."), ts('Warning'), 'warning');
             }
         }
     }
     $financialType->save();
     // CRM-12470
     if (empty($ids['financialType']) && empty($params['id'])) {
         $titles = CRM_Financial_BAO_FinancialTypeAccount::createDefaultFinancialAccounts($financialType);
         $financialType->titles = $titles;
     }
     return $financialType;
 }
开发者ID:rameshrr99,项目名称:civicrm-core,代码行数:37,代码来源:FinancialType.php


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