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


PHP CRM_Contact_BAO_Contact::get方法代码示例

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


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

示例1: preProcess

 function preProcess()
 {
     $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
     $this->assign('contactId', $this->_contactId);
     $contact = new CRM_Contact_BAO_Contact();
     $contact->get('id', $this->_contactId);
     $this->_apiKey = $contact->api_key;
     $this->assign('apiKey', $this->_apiKey);
     // check logged in url permission
     CRM_Contact_Page_View::checkUserPermission($this);
     // set page title
     CRM_Contact_Page_View::setTitle($this->_contactId);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
     $this->assign('action', $this->_action);
     $isAdmin = CRM_Core_Permission::check('administer CiviCRM') && CRM_Core_Permission::check('edit all contacts');
     $session = CRM_Core_Session::singleton();
     $isMyself = $this->_contactId && $this->_contactId == $session->get('userID');
     $this->assign('isAdmin', $isAdmin);
     $this->assign('isMyself', $isMyself);
     $urlParam = 'reset=1&action=add&cid=' . $this->_contactId;
     if ($this->_apiKey) {
         $urlParam = 'reset=1&action=edit&cid=' . $this->_contactId;
     }
     $this->assign('addApiKeyUrl', CRM_Utils_System::url('civicrm/contact/apikey', $urlParam));
 }
开发者ID:Beltline,项目名称:com.cividesk.apikey,代码行数:25,代码来源:APIKey.php

示例2: addContactTokens

 function addContactTokens($contact_id, $variable_name)
 {
     if (empty($contact_id)) {
         return;
     }
     // use the API to load a extensive contact information bulk
     $contact = civicrm_api('Contact', 'getsingle', array('id' => $contact_id, 'version' => 3));
     // ... add some missing fields
     $bao = new CRM_Contact_BAO_Contact();
     $bao->get('id', $contact_id);
     $contact['postal_greeting_display'] = $bao->postal_greeting_display;
     $contact['email_greeting_display'] = $bao->email_greeting_display;
     $contact['addressee_display'] = $bao->addressee_display;
     if (empty($contact['is_error'])) {
         $this->assign($variable_name, $contact);
     }
 }
开发者ID:FundingWorks,项目名称:org.project60.sepa,代码行数:17,代码来源:SepaMandatePdf.php

示例3: getContributor

 /**
  * read out the contributor
  */
 public function getContributor($contact_id)
 {
     if ($this->cached_contributors[$contact_id]) {
         return $this->cached_contributors[$contact_id];
     }
     // not cached? build it.
     $contributor = array();
     // load the contact
     $contact = new CRM_Contact_BAO_Contact();
     $contact->get('id', $contact_id);
     // copy the base values
     foreach (CRM_Donrec_Logic_ReceiptTokens::$STORED_TOKENS['contributor'] as $key => $value) {
         if (isset($contact->{$key})) {
             $contributor[$key] = $contact->{$key};
         }
     }
     // add the addresses
     $types = $this->getProfile()->getLocationTypes()['legal'];
     $contributor_address = $this->lookupAddressTokens($contact_id, $types['address'], $types['fallback']);
     if ($contributor_address != NULL) {
         $contributor = array_merge($contributor, $contributor_address);
     }
     // cache the result
     $this->cached_contributors[$contact_id] = $contributor;
     return $contributor;
 }
开发者ID:systopia,项目名称:de.systopia.donrec,代码行数:29,代码来源:SnapshotReceipt.php

示例4: lookupAddressTokens

 /**
  * Get address tokens for a given contact with fallback type
  */
 public static function lookupAddressTokens($contact_id, $location_type, $fallback_location_type)
 {
     if (empty($contact_id)) {
         return array();
     }
     // find the address
     $address = self::_lookupAddress($contact_id, $location_type);
     if ($address == NULL) {
         $address = self::_lookupAddress($contact_id, $fallback_location_type);
     }
     if ($address == NULL) {
         // no address found
         return array();
     }
     //add contact information
     $contact_bao = new CRM_Contact_BAO_Contact();
     $contact_bao->get('id', $contact_id);
     $address['display_name'] = $contact_bao->display_name;
     $address['addressee'] = $contact_bao->addressee_display;
     return $address;
 }
开发者ID:systopia,项目名称:de.systopia.donrec,代码行数:24,代码来源:ReceiptTokens.php


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