本文整理汇总了PHP中CRM_Contact_BAO_Contact::contactDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact::contactDetails方法的具体用法?PHP CRM_Contact_BAO_Contact::contactDetails怎么用?PHP CRM_Contact_BAO_Contact::contactDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Contact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Contact::contactDetails方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setDefaultValues
function setDefaultValues()
{
// check if the user is registered and we have a contact ID
$session =& CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if ($contactID) {
$options = array();
$fields = array();
foreach ($this->_fields as $name => $dontCare) {
$fields[$name] = 1;
}
$fields['state_province'] = $fields['country'] = $fields['email'] = 1;
$contact =& CRM_Contact_BAO_Contact::contactDetails($contactID, $options, $fields);
foreach ($fields as $name => $dontCare) {
if ($contact->{$name}) {
if (substr($name, 0, 7) == 'custom_') {
$id = substr($name, 7);
$this->_defaults[$name] = CRM_Core_BAO_CustomField::getDefaultValue($contact->{$name}, $id, $options);
} else {
$this->_defaults[$name] = $contact->{$name};
}
}
}
}
// hack to simplify credit card entry for testing
/**
$this->_defaults['credit_card_type'] = 'Visa';
$this->_defaults['credit_card_number'] = '4807731747657838';
$this->_defaults['cvv2'] = '000';
$this->_defaults['credit_card_exp_date'] = array( 'Y' => '2008', 'M' => '01' );
**/
return $this->_defaults;
}