3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class holds all the Pseudo constants those
20 * are specific to Campaign and Survey.
22 class CRM_Campaign_PseudoConstant
extends CRM_Core_PseudoConstant
{
28 private static $activityType;
34 private static $campaignType = [];
40 private static $campaignStatus = [];
46 private static $engagementLevel;
49 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
50 * Get all the survey activity types
52 * @param string $returnColumn
55 * array reference of all survey activity types.
57 public static function &activityType($returnColumn = 'name') {
58 $cacheKey = $returnColumn;
59 if (!isset(self
::$activityType[$cacheKey])) {
60 $campaingCompId = CRM_Core_Component
::getComponentID('CiviCampaign');
61 if ($campaingCompId) {
62 self
::$activityType[$cacheKey] = CRM_Core_OptionGroup
::values('activity_type',
64 " AND v.component_id={$campaingCompId}",
69 asort(self
::$activityType[$cacheKey]);
70 return self
::$activityType[$cacheKey];
74 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
75 * Get all campaign types.
77 * The static array campaignType is returned
81 * array reference of all campaign types.
83 public static function &campaignType() {
84 if (!self
::$campaignType) {
85 self
::$campaignType = CRM_Core_OptionGroup
::values('campaign_type');
87 asort(self
::$campaignType);
88 return self
::$campaignType;
92 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
93 * Get all campaign status.
95 * The static array campaignStatus is returned
99 * array reference of all campaign status.
101 public static function &campaignStatus() {
102 if (!self
::$campaignStatus) {
103 self
::$campaignStatus = CRM_Core_OptionGroup
::values('campaign_status');
105 asort(self
::$campaignStatus);
106 return self
::$campaignStatus;
110 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
111 * Get all Engagement Level.
113 * The static array Engagement Level is returned
117 * array reference of all Engagement Level.
119 public static function &engagementLevel() {
120 if (!isset(self
::$engagementLevel)) {
121 self
::$engagementLevel = CRM_Core_OptionGroup
::values('engagement_index');
124 return self
::$engagementLevel;
128 * Flush given pseudoconstant so it can be reread from db
129 * next time it's requested.
132 * @param bool|string $name pseudoconstant to be flushed
134 public static function flush($name = 'cache') {
135 if (isset(self
::$
$name)) {