本文整理匯總了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);
}