3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
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-2013
37 * This class holds all the Pseudo constants those
38 * are specific to Campaign and Survey.
40 class CRM_Campaign_PseudoConstant
extends CRM_Core_PseudoConstant
{
47 private static $activityType;
54 private static $campaignType = array();
61 private static $campaignStatus = array();
67 private static $engagementLevel;
70 * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
71 * Get all the survey activity types
75 * @return array - array reference of all survey activity types.
78 public static function &activityType($returnColumn = 'name') {
79 $cacheKey = $returnColumn;
80 if (!isset(self
::$activityType[$cacheKey])) {
81 $campaingCompId = CRM_Core_Component
::getComponentID('CiviCampaign');
82 if ($campaingCompId) {
83 self
::$activityType[$cacheKey] = CRM_Core_OptionGroup
::values('activity_type',
85 " AND v.component_id={$campaingCompId}",
90 asort(self
::$activityType[$cacheKey]);
91 return self
::$activityType[$cacheKey];
95 * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
96 * Get all campaign types.
98 * The static array campaignType is returned
103 * @return array - array reference of all campaign types.
106 public static function &campaignType() {
107 if (!self
::$campaignType) {
108 self
::$campaignType = CRM_Core_OptionGroup
::values('campaign_type');
110 asort(self
::$campaignType);
111 return self
::$campaignType;
115 * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
116 * Get all campaign status.
118 * The static array campaignStatus is returned
123 * @return array - array reference of all campaign status.
126 public static function &campaignStatus() {
127 if (!self
::$campaignStatus) {
128 self
::$campaignStatus = CRM_Core_OptionGroup
::values('campaign_status');
130 asort(self
::$campaignStatus);
131 return self
::$campaignStatus;
135 * DEPRECATED. Please use the buildOptions() method in the appropriate BAO object.
136 * Get all Engagement Level.
138 * The static array Engagement Level is returned
143 * @return array - array reference of all Engagement Level.
145 public static function &engagementLevel() {
146 if (!isset(self
::$engagementLevel)) {
147 self
::$engagementLevel = CRM_Core_OptionGroup
::values('engagement_index');
150 return self
::$engagementLevel;
154 * Flush given pseudoconstant so it can be reread from db
155 * next time it's requested.
160 * @param boolean $name pseudoconstant to be flushed
163 public static function flush($name = 'cache') {
164 if (isset(self
::$
$name)) {