當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。