本文整理汇总了PHP中CRM_Core_PseudoConstant::autoRenew方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::autoRenew方法的具体用法?PHP CRM_Core_PseudoConstant::autoRenew怎么用?PHP CRM_Core_PseudoConstant::autoRenew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Core_PseudoConstant::autoRenew方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: asort
/**
* Retrieve list of Scheduled Reminders
*
* @param bool $namesOnly return simple list of names
*
* @return array (reference) reminder list
* @static
* @access public
*/
static function &getList($namesOnly = FALSE, $entityValue = NULL, $id = NULL)
{
$activity_type = CRM_Core_PseudoConstant::activityType(FALSE) + CRM_Core_PseudoConstant::activityType(FALSE, TRUE);
$activity_status = CRM_Core_PseudoConstant::activityStatus();
$event_type = CRM_Event_PseudoConstant::eventType();
$civicrm_event = CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
$civicrm_participant_status_type = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
$auto_renew_options = CRM_Core_PseudoConstant::autoRenew();
$civicrm_membership_type = CRM_Member_PseudoConstant::membershipType();
asort($activity_type);
$entity = array('civicrm_activity' => 'Activity', 'civicrm_participant' => 'Event', 'civicrm_membership' => 'Member');
$query = "\nSELECT\n title,\n cam.entity,\n cas.id as id,\n cam.entity_value as entityValue,\n cas.entity_value as entityValueIds,\n cam.entity_status as entityStatus,\n cas.entity_status as entityStatusIds,\n cas.start_action_date as entityDate,\n cas.start_action_offset,\n cas.start_action_unit,\n cas.start_action_condition,\n cas.absolute_date,\n is_repeat,\n is_active\n\nFROM civicrm_action_schedule cas\nLEFT JOIN civicrm_action_mapping cam ON (cam.id = cas.mapping_id)\n";
$params = CRM_Core_DAO::$_nullArray;
if ($entityValue and $id) {
$where = "\nWHERE cas.entity_value = {$id} AND\n cam.entity_value = '{$entityValue}'";
$query .= $where;
$params = array(1 => array($id, 'Integer'), 2 => array($entityValue, 'String'));
}
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
$list[$dao->id]['id'] = $dao->id;
$list[$dao->id]['title'] = $dao->title;
$list[$dao->id]['start_action_offset'] = $dao->start_action_offset;
$list[$dao->id]['start_action_unit'] = $dao->start_action_unit;
$list[$dao->id]['start_action_condition'] = $dao->start_action_condition;
$list[$dao->id]['entityDate'] = ucwords(str_replace('_', ' ', $dao->entityDate));
$list[$dao->id]['absolute_date'] = $dao->absolute_date;
$status = $dao->entityStatus;
$statusArray = explode(CRM_Core_DAO::VALUE_SEPARATOR, $dao->entityStatusIds);
foreach ($statusArray as &$s) {
$s = CRM_Utils_Array::value($s, ${$status});
}
$statusIds = implode(', ', $statusArray);
$value = $dao->entityValue;
$valueArray = explode(CRM_Core_DAO::VALUE_SEPARATOR, $dao->entityValueIds);
foreach ($valueArray as &$v) {
$v = CRM_Utils_Array::value($v, ${$value});
}
$valueIds = implode(', ', $valueArray);
$list[$dao->id]['entity'] = $entity[$dao->entity];
$list[$dao->id]['value'] = $valueIds;
$list[$dao->id]['status'] = $statusIds;
$list[$dao->id]['is_repeat'] = $dao->is_repeat;
$list[$dao->id]['is_active'] = $dao->is_active;
}
return $list;
}
示例2:
/**
* Get all the auto renew options
*
* @access public
* @static
*
* @return array self::autoRenew - array reference of all autoRenew
*
*/
public static function &autoRenew()
{
if (!self::$autoRenew) {
self::$autoRenew = CRM_Core_OptionGroup::values('auto_renew_options', FALSE, FALSE);
}
return self::$autoRenew;
}