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


PHP CRM_Core_BAO_UFMatch::updateUFEmail方法代码示例

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


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

示例1: str_replace

 /**
  * takes an associative array and creates a contact object and all the associated
  * derived objects (i.e. individual, location, email, phone etc)
  *
  * This function is invoked from within the web form layer and also from the api layer
  *
  * @param array $params (reference ) an assoc array of name/value pairs
  * @param array $ids    the array that holds all the db ids
  * @param int   $maxLocationBlocks the maximum number of location blocks to process
  *
  * @return object CRM_Contact_BAO_Contact object 
  * @access public
  * @static
  */
 function &create(&$params, &$ids, $maxLocationBlocks)
 {
     require_once 'CRM/Utils/Hook.php';
     if (CRM_Utils_Array::value('contact', $ids)) {
         CRM_Utils_Hook::pre('edit', $params['contact_type'], $ids['contact'], $params);
     } else {
         CRM_Utils_Hook::pre('create', $params['contact_type'], null, $params);
     }
     CRM_Core_DAO::transaction('BEGIN');
     $contact = CRM_Contact_BAO_Contact::add($params, $ids);
     $params['contact_id'] = $contact->id;
     // invoke the add operator on the contact_type class
     require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_BAO_" . $params['contact_type']) . ".php";
     eval('$contact->contact_type_object =& CRM_Contact_BAO_' . $params['contact_type'] . '::add($params, $ids);');
     $location = array();
     for ($locationId = 1; $locationId <= $maxLocationBlocks; $locationId++) {
         // start of for loop for location
         $location[$locationId] = CRM_Core_BAO_Location::add($params, $ids, $locationId);
     }
     $contact->location = $location;
     // add notes
     if (CRM_Utils_Array::value('note', $params)) {
         if (is_array($params['note'])) {
             foreach ($params['note'] as $note) {
                 $noteParams = array('entity_id' => $contact->id, 'entity_table' => 'civicrm_contact', 'note' => $note['note']);
                 CRM_Core_BAO_Note::add($noteParams);
             }
         } else {
             $noteParams = array('entity_id' => $contact->id, 'entity_table' => 'civicrm_contact', 'note' => $params['note']);
             CRM_Core_BAO_Note::add($noteParams);
         }
     }
     // update the UF email if that has changed
     require_once 'CRM/Core/BAO/UFMatch.php';
     CRM_Core_BAO_UFMatch::updateUFEmail($contact->id);
     // add custom field values
     if (CRM_Utils_Array::value('custom', $params)) {
         foreach ($params['custom'] as $customValue) {
             $cvParams = array('entity_table' => 'civicrm_contact', 'entity_id' => $contact->id, 'value' => $customValue['value'], 'type' => $customValue['type'], 'custom_field_id' => $customValue['custom_field_id']);
             if ($customValue['id']) {
                 $cvParams['id'] = $customValue['id'];
             }
             CRM_Core_BAO_CustomValue::create($cvParams);
         }
     }
     // make a civicrm_subscription_history entry only on contact create (CRM-777)
     if (!CRM_Utils_Array::value('contact', $ids)) {
         $subscriptionParams = array('contact_id' => $contact->id, 'status' => 'Added', 'method' => 'Admin');
         CRM_Contact_BAO_SubscriptionHistory::create($subscriptionParams);
     }
     CRM_Core_DAO::transaction('COMMIT');
     if (CRM_Utils_Array::value('contact', $ids)) {
         CRM_Utils_Hook::post('edit', $params['contact_type'], $contact->id, $contact);
     } else {
         CRM_Utils_Hook::post('create', $params['contact_type'], $contact->id, $contact);
     }
     $contact->contact_type_display = CRM_Contact_DAO_Contact::tsEnum('contact_type', $contact->contact_type);
     return $contact;
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:73,代码来源:Contact.php


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