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


PHP CRM_Contact_BAO_Contact::getPrimaryOpenId方法代码示例

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


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

示例1: updateUFName

 /**
  * update the uf_name in the user object
  *
  * @param int    $contactId id of the contact to update
  *
  * @return void
  * @access public
  * @static
  */
 static function updateUFName($contactId)
 {
     $config =& CRM_Core_Config::singleton();
     if ($config->userFramework == 'Standalone') {
         $ufName = CRM_Contact_BAO_Contact::getPrimaryOpenId($contactId);
     } else {
         $ufName = CRM_Contact_BAO_Contact::getPrimaryEmail($contactId);
     }
     if (!$ufName) {
         return;
     }
     $ufmatch =& new CRM_Core_DAO_UFMatch();
     $ufmatch->contact_id = $contactId;
     $ufmatch->domain_id = CRM_Core_Config::domainID();
     if (!$ufmatch->find(true) || $ufmatch->uf_name == $ufName) {
         // if object does not exist or the OpenID has not changed
         return;
     }
     // save the updated ufmatch object
     $ufmatch->uf_name = $ufName;
     $ufmatch->save();
     require_once 'CRM/Core/BAO/CMSUser.php';
     CRM_Core_BAO_CMSUser::updateUFName($ufmatch->uf_id, $ufName);
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:33,代码来源:UFMatch.php

示例2: testGetPrimaryOpenId

 /**
  * Test case for getPrimaryOpenId( ).
  */
 public function testGetPrimaryOpenId()
 {
     //get the contact params
     $params = $this->contactParams();
     $params['openid'][2] = $params['openid'][1];
     $params['openid'][2]['location_type_id'] = 2;
     $params['openid'][2]['openid'] = 'http://primaryopenid.org/';
     unset($params['openid'][1]['is_primary']);
     //create contact
     $contact = CRM_Contact_BAO_Contact::create($params);
     $contactId = $contact->id;
     //get the primary openid
     $openID = CRM_Contact_BAO_Contact::getPrimaryOpenId($contactId);
     //Now check the primary openid
     $this->assertEquals($openID, strtolower($params['openid'][2]['openid']), 'Check Primary OpenID');
     //cleanup DB by deleting the contact
     $this->contactDelete($contactId);
 }
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:21,代码来源:ContactTest.php

示例3: updateUFName

 /**
  * update the uf_name in the user object
  *
  * @param int    $contactId id of the contact to update
  *
  * @return void
  * @access public
  * @static
  */
 static function updateUFName($contactId)
 {
     if (!$contactId) {
         return;
     }
     $config = CRM_Core_Config::singleton();
     if ($config->userFramework == 'Standalone') {
         $ufName = CRM_Contact_BAO_Contact::getPrimaryOpenId($contactId);
     } else {
         $ufName = CRM_Contact_BAO_Contact::getPrimaryEmail($contactId);
     }
     if (!$ufName) {
         return;
     }
     $update = false;
     // 1.do check for contact Id.
     $ufmatch = new CRM_Core_DAO_UFMatch();
     $ufmatch->contact_id = $contactId;
     $ufmatch->domain_id = CRM_Core_Config::domainID();
     if (!$ufmatch->find(true)) {
         return;
     }
     if ($ufmatch->uf_name != $ufName) {
         $update = true;
     }
     // CRM-6928
     // 2.do check for duplicate ufName.
     $ufDupeName = new CRM_Core_DAO_UFMatch();
     $ufDupeName->uf_name = $ufName;
     $ufDupeName->domain_id = CRM_Core_Config::domainID();
     if ($ufDupeName->find(true) && $ufDupeName->contact_id != $contactId) {
         $update = false;
     }
     if (!$update) {
         return;
     }
     // save the updated ufmatch object
     $ufmatch->uf_name = $ufName;
     $ufmatch->save();
     require_once 'CRM/Core/BAO/CMSUser.php';
     CRM_Core_BAO_CMSUser::updateUFName($ufmatch->uf_id, $ufName);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:51,代码来源:UFMatch.php


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