本文整理汇总了PHP中CRM_Core_PseudoConstant::activityContacts方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::activityContacts方法的具体用法?PHP CRM_Core_PseudoConstant::activityContacts怎么用?PHP CRM_Core_PseudoConstant::activityContacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Core_PseudoConstant::activityContacts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSelection1
static function getSelection1($id = NULL)
{
$mapping = self::getMapping($id);
$sel4 = $sel5 = array();
$options = array('manual' => ts('Choose Recipient(s)'), 'group' => ts('Select a Group'));
$recipientMapping = array_combine(array_keys($options), array_keys($options));
foreach ($mapping as $value) {
$entityRecipient = CRM_Utils_Array::value('entity_recipient', $value);
$key = CRM_Utils_Array::value('id', $value);
if ($startDate = CRM_Utils_Array::value('entity_date_start', $value)) {
$sel4[$startDate] = ucwords(str_replace('_', ' ', $startDate));
}
if ($endDate = CRM_Utils_Array::value('entity_date_end', $value)) {
$sel4[$endDate] = ucwords(str_replace('_', ' ', $endDate));
}
switch ($entityRecipient) {
case 'activity_contacts':
$activityContacts = CRM_Core_PseudoConstant::activityContacts();
$sel5[$id] = $activityContacts + $options;
$recipientMapping += CRM_Core_PseudoConstant::activityContacts('name');
break;
case 'event_contacts':
$eventContacts = CRM_Core_PseudoConstant::eventContacts();
$sel5[$id] = $eventContacts + $options;
$recipientMapping += CRM_Core_PseudoConstant::eventContacts('name');
break;
case NULL:
$sel5[$id] = $options;
break;
}
}
return array('sel4' => $sel4, 'sel5' => $sel5[$id], 'recipientMapping' => $recipientMapping);
}
示例2:
/**
* Get all Activity Contacts
*
* The static array activityContacts is returned
*
* @access public
* @static
*
* @param string $column db column name/label.
*
* @return array - array reference of all activity Contacts
*
*/
public static function &activityContacts($column = 'label')
{
if (!self::$activityContacts) {
self::$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, $column);
}
return self::$activityContacts;
}