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


PHP CRM_Price_BAO_LineItem::save方法代碼示例

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


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

示例1: create

 /**
  * Creates a new entry in the database.
  *
  * @param array $params
  *   (reference) an assoc array of name/value pairs.
  *
  * @return CRM_Price_DAO_LineItem
  */
 public static function create(&$params)
 {
     $id = CRM_Utils_Array::value('id', $params);
     if ($id) {
         CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params);
         $op = CRM_Core_Action::UPDATE;
     } else {
         CRM_Utils_Hook::pre('create', 'LineItem', $params['entity_id'], $params);
         $op = CRM_Core_Action::ADD;
     }
     // unset entity table and entity id in $params
     // we never update the entity table and entity id during update mode
     if ($id) {
         unset($params['entity_id'], $params['entity_table']);
     }
     if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && CRM_Utils_Array::value('check_permissions', $params)) {
         if (empty($params['financial_type_id'])) {
             throw new Exception('Mandatory key(s) missing from params array: financial_type_id');
         }
         CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($types, $op);
         if (!in_array($params['financial_type_id'], array_keys($types))) {
             throw new Exception('You do not have permission to create this line item');
         }
     }
     $lineItemBAO = new CRM_Price_BAO_LineItem();
     $lineItemBAO->copyValues($params);
     $return = $lineItemBAO->save();
     if ($id) {
         CRM_Utils_Hook::post('edit', 'LineItem', $id, $lineItemBAO);
     } else {
         CRM_Utils_Hook::post('create', 'LineItem', $lineItemBAO->id, $lineItemBAO);
     }
     return $return;
 }
開發者ID:saurabhbatra96,項目名稱:civicrm-core,代碼行數:42,代碼來源:LineItem.php

示例2: create

 /**
  * Creates a new entry in the database.
  *
  * @param array $params (reference) an assoc array of name/value pairs
  *
  * @return object CRM_Price_DAO_LineItem object
  * @access public
  * @static
  */
 static function create(&$params)
 {
     //create mode only as we don't support editing line items
     CRM_Utils_Hook::pre('create', 'LineItem', $params['entity_id'], $params);
     $lineItemBAO = new CRM_Price_BAO_LineItem();
     $lineItemBAO->copyValues($params);
     $return = $lineItemBAO->save();
     CRM_Utils_Hook::post('create', 'LineItem', $params['entity_id'], $params);
     return $return;
 }
開發者ID:TheCraftyCanvas,項目名稱:aegir-platforms,代碼行數:19,代碼來源:LineItem.php

示例3: create

 /**
  * Creates a new entry in the database.
  *
  * @param array $params
  *   (reference) an assoc array of name/value pairs.
  *
  * @return CRM_Price_DAO_LineItem
  */
 public static function create(&$params)
 {
     $id = CRM_Utils_Array::value('id', $params);
     if ($id) {
         CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params);
     } else {
         CRM_Utils_Hook::pre('create', 'LineItem', $params['entity_id'], $params);
     }
     // unset entity table and entity id in $params
     // we never update the entity table and entity id during update mode
     if ($id) {
         unset($params['entity_id'], $params['entity_table']);
     }
     $lineItemBAO = new CRM_Price_BAO_LineItem();
     $lineItemBAO->copyValues($params);
     $return = $lineItemBAO->save();
     if ($id) {
         CRM_Utils_Hook::post('edit', 'LineItem', $id, $lineItemBAO);
     } else {
         CRM_Utils_Hook::post('create', 'LineItem', $lineItemBAO->id, $lineItemBAO);
     }
     return $return;
 }
開發者ID:nganivet,項目名稱:civicrm-core,代碼行數:31,代碼來源:LineItem.php

示例4: create

 /**
  * Creates a new entry in the database.
  *
  * @param array $params (reference) an assoc array of name/value pairs
  *
  * @return object CRM_Price_DAO_LineItem object
  * @access public
  * @static
  */
 static function create(&$params)
 {
     $lineItemBAO = new CRM_Price_BAO_LineItem();
     $lineItemBAO->copyValues($params);
     return $lineItemBAO->save();
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:15,代碼來源:LineItem.php


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