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


PHP CRM_Member_BAO_Membership::sortName方法代码示例

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


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

示例1: setDefaultValues

 /**
  * This function sets the default values for the form.
  * 
  * @access public
  * @return None
  */
 function setDefaultValues()
 {
     if (empty($this->_fields)) {
         return;
     }
     $defaults = array();
     foreach ($this->_memberIds as $memberId) {
         $details[$memberId] = array();
         //build sortname
         require_once "CRM/Member/BAO/Membership.php";
         $sortName[$memberId] = CRM_Member_BAO_Membership::sortName($memberId);
         CRM_Core_BAO_UFGroup::setProfileDefaults(null, $this->_fields, $defaults, false, $memberId, 'Membership');
     }
     $this->assign('sortName', $sortName);
     return $defaults;
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:22,代码来源:Batch.php

示例2: testsortName

 /**
  * Take sort name of contact during
  * Update multiple memberships
  */
 public function testsortName()
 {
     $contactId = Contact::createIndividual();
     $params = array('contact_id' => $contactId, 'membership_type_id' => $this->_membershipTypeID, 'join_date' => date('Ymd', strtotime('2006-01-21')), 'start_date' => date('Ymd', strtotime('2006-01-21')), 'end_date' => date('Ymd', strtotime('2006-12-21')), 'source' => 'Payment', 'is_override' => 1, 'status_id' => $this->_membershipStatusID);
     $ids = array();
     CRM_Member_BAO_Membership::create($params, $ids);
     $membershipId = $this->assertDBNotNull('CRM_Member_BAO_Membership', $contactId, 'id', 'contact_id', 'Database check for created membership.');
     CRM_Member_BAO_Membership::sortName($membershipId);
     $this->assertDBCompareValue('CRM_Contact_DAO_Contact', $contactId, 'sort_name', 'id', 'Doe, John', 'Database check for sort name record.');
     $this->membershipDelete($membershipId);
     Contact::delete($contactId);
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:16,代码来源:MembershipTest.php

示例3: testSortName

 /**
  * Checkup sort name function.
  */
 public function testSortName()
 {
     $contactId = $this->individualCreate();
     $params = array('contact_id' => $contactId, 'membership_type_id' => $this->_membershipTypeID, 'join_date' => '2006-01-21', 'start_date' => '2006-01-21', 'end_date' => '2006-12-21', 'source' => 'Payment', 'is_override' => 1, 'status_id' => $this->_membershipStatusID);
     $membership = $this->callAPISuccess('Membership', 'create', $params);
     $this->assertEquals('Anderson, Anthony', CRM_Member_BAO_Membership::sortName($membership['id']));
     $this->membershipDelete($membership['id']);
     $this->contactDelete($contactId);
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:12,代码来源:MembershipTest.php


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