本文整理汇总了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;
}
示例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);
}
示例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);
}