本文整理匯總了PHP中CRM_Utils_Token::replaceEntityTokens方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Utils_Token::replaceEntityTokens方法的具體用法?PHP CRM_Utils_Token::replaceEntityTokens怎麽用?PHP CRM_Utils_Token::replaceEntityTokens使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Utils_Token
的用法示例。
在下文中一共展示了CRM_Utils_Token::replaceEntityTokens方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: generateHTML
/**
* generate htmlfor pdf letters
*
* @param array $membershipIDs
* @param array $returnProperties
* @param bool $skipOnHold
* @param bool $skipDeceased
* @param unknown_type $messageToken
* @param $html_message
* @param $categories
*
* @return unknown
*/
static function generateHTML($membershipIDs, $returnProperties, $skipOnHold, $skipDeceased, $messageToken, $html_message, $categories)
{
$memberships = CRM_Utils_Token::getMembershipTokenDetails($membershipIDs);
foreach ($membershipIDs as $membershipID) {
$membership = $memberships[$membershipID];
// get contact information
$contactId = $membership['contact_id'];
$params = array('contact_id' => $contactId);
//getTokenDetails is much like calling the api contact.get function - but - with some minor
// special handlings. It preceeds the existence of the api
list($contacts) = CRM_Utils_Token::getTokenDetails($params, $returnProperties, $skipOnHold, $skipDeceased, NULL, $messageToken, 'CRM_Contribution_Form_Task_PDFLetterCommon');
$tokenHtml = CRM_Utils_Token::replaceContactTokens($html_message, $contacts[$contactId], TRUE, $messageToken);
$tokenHtml = CRM_Utils_Token::replaceEntityTokens('membership', $membership, $tokenHtml, $messageToken);
$tokenHtml = CRM_Utils_Token::replaceHookTokens($tokenHtml, $contacts[$contactId], $categories, TRUE);
$tokenHtml = CRM_Utils_Token::parseThroughSmarty($tokenHtml, $contacts[$contactId]);
$html[] = $tokenHtml;
}
return $html;
}