本文整理汇总了PHP中CRM_Contact_BAO_Contact::allEmails方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_Contact::allEmails方法的具体用法?PHP CRM_Contact_BAO_Contact::allEmails怎么用?PHP CRM_Contact_BAO_Contact::allEmails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_Contact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_Contact::allEmails方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
$cid = CRM_Utils_Request::retrieve('cid', $this, false);
if ($cid) {
// not sure why this is needed :(
// also add the cid params to the Menu array
CRM_Utils_Menu::addParam('cid', $cid);
// create menus ..
$startWeight = CRM_Utils_Menu::getMaxWeight('civicrm/contact/view');
$startWeight++;
CRM_Core_BAO_CustomGroup::addMenuTabs(CRM_Contact_BAO_Contact::getContactType($cid), 'civicrm/contact/view/cd', $startWeight);
$this->_contactIds = array($cid);
$this->_single = true;
$emails = CRM_Contact_BAO_Contact::allEmails($cid);
$this->_emails = array();
$toName = CRM_Contact_BAO_Contact::displayName($cid);
foreach ($emails as $email => $item) {
if (!$email && count($emails) <= 1) {
$this->_emails[$email] = '"' . $toName . '"';
$this->_noEmails = true;
} else {
if ($email) {
$this->_emails[$email] = '"' . $toName . '" <' . $email . '> ' . $item['locationType'];
}
}
if ($item['is_primary']) {
$this->_emails[$email] .= ' ' . ts('(preferred)');
}
$this->_emails[$email] = htmlspecialchars($this->_emails[$email]);
}
} else {
parent::preProcess();
}
$this->assign('single', $this->_single);
}