ts('Positive'), 'Pending' => ts('Pending'), 'Waiting' => ts('Waiting'), 'Negative' => ts('Negative'), ); } /** * Return a status-type-keyed array of status classes * * @return array * Array of status classes, keyed by status type */ public static function &participantStatusClass() { static $statusClasses = NULL; if ($statusClasses === NULL) { self::populate($statusClasses, 'CRM_Event_DAO_ParticipantStatusType', TRUE, 'class'); } return $statusClasses; } /** * Get all the n participant roles * * * @param int $id * @param null $cond * * @return array * array reference of all participant roles if any */ public static function &participantRole($id = NULL, $cond = NULL) { $index = $cond ? $cond : 'No Condition'; if (!CRM_Utils_Array::value($index, self::$participantRole)) { self::$participantRole[$index] = array(); $condition = NULL; if ($cond) { $condition = "AND $cond"; } self::$participantRole[$index] = CRM_Core_OptionGroup::values('participant_role', FALSE, FALSE, FALSE, $condition ); } if ($id) { return self::$participantRole[$index][$id]; } return self::$participantRole[$index]; } /** * Get all the participant listings * * * @param int $id * * @return array * array reference of all participant listings if any */ public static function &participantListing($id = NULL) { if (!self::$participantListing) { self::$participantListing = array(); self::$participantListing = CRM_Core_OptionGroup::values('participant_listing'); } if ($id) { return self::$participantListing[$id]; } return self::$participantListing; } /** * Get all event types. * * * @param int $id * @return array * array reference of all event types. */ public static function &eventType($id = NULL) { if (!self::$eventType) { self::$eventType = array(); self::$eventType = CRM_Core_OptionGroup::values('event_type'); } if ($id) { return self::$eventType[$id]; } return self::$eventType; } /** * Get event template titles * * @param int $id * * @return array * Array of event id → template title pairs */ public static function &eventTemplates($id = NULL) { if (!self::$eventTemplates) { CRM_Core_PseudoConstant::populate(self::$eventTemplates, 'CRM_Event_DAO_Event', FALSE, 'template_title', 'is_active', 'is_template = 1' ); } if ($id) { return self::$eventTemplates[$id]; } return self::$eventTemplates; } /** * Flush given pseudoconstant so it can be reread from db * nex time it's requested. * * * @param bool|string $name pseudoconstant to be flushed */ public static function flush($name = 'cache') { if (isset(self::$$name)) { self::$$name = NULL; } } /** * Get all the Personal campaign pages * * * @param int $id * @return array * array reference of all pcp if any */ public static function &pcPage($id = NULL) { if (!self::$pcPage) { CRM_Core_PseudoConstant::populate(self::$pcPage, 'CRM_PCP_DAO_PCP', FALSE, 'title' ); } if ($id) { return CRM_Utils_Array::value($id, self::$pcPage); } return self::$pcPage; } }