3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2019
35 * This class holds all the Pseudo constants those
36 * are specific to Campaign and Survey.
38 class CRM_Campaign_PseudoConstant
extends CRM_Core_PseudoConstant
{
44 private static $activityType;
50 private static $campaignType = [];
56 private static $campaignStatus = [];
62 private static $engagementLevel;
65 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
66 * Get all the survey activity types
68 * @param string $returnColumn
71 * array reference of all survey activity types.
73 public static function &activityType($returnColumn = 'name') {
74 $cacheKey = $returnColumn;
75 if (!isset(self
::$activityType[$cacheKey])) {
76 $campaingCompId = CRM_Core_Component
::getComponentID('CiviCampaign');
77 if ($campaingCompId) {
78 self
::$activityType[$cacheKey] = CRM_Core_OptionGroup
::values('activity_type',
80 " AND v.component_id={$campaingCompId}",
85 asort(self
::$activityType[$cacheKey]);
86 return self
::$activityType[$cacheKey];
90 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
91 * Get all campaign types.
93 * The static array campaignType is returned
97 * array reference of all campaign types.
99 public static function &campaignType() {
100 if (!self
::$campaignType) {
101 self
::$campaignType = CRM_Core_OptionGroup
::values('campaign_type');
103 asort(self
::$campaignType);
104 return self
::$campaignType;
108 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
109 * Get all campaign status.
111 * The static array campaignStatus is returned
115 * array reference of all campaign status.
117 public static function &campaignStatus() {
118 if (!self
::$campaignStatus) {
119 self
::$campaignStatus = CRM_Core_OptionGroup
::values('campaign_status');
121 asort(self
::$campaignStatus);
122 return self
::$campaignStatus;
126 * @deprecated. Please use the buildOptions() method in the appropriate BAO object.
127 * Get all Engagement Level.
129 * The static array Engagement Level is returned
133 * array reference of all Engagement Level.
135 public static function &engagementLevel() {
136 if (!isset(self
::$engagementLevel)) {
137 self
::$engagementLevel = CRM_Core_OptionGroup
::values('engagement_index');
140 return self
::$engagementLevel;
144 * Flush given pseudoconstant so it can be reread from db
145 * next time it's requested.
148 * @param bool|string $name pseudoconstant to be flushed
150 public static function flush($name = 'cache') {
151 if (isset(self
::$
$name)) {