commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Campaign / DAO / CampaignGroup.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2015
30 *
31 * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_campaign_group';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = false;
82 /**
83 * Campaign Group id.
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Foreign key to the activity Campaign.
90 *
91 * @var int unsigned
92 */
93 public $campaign_id;
94 /**
95 * Type of Group.
96 *
97 * @var string
98 */
99 public $group_type;
100 /**
101 * Name of table where item being referenced is stored.
102 *
103 * @var string
104 */
105 public $entity_table;
106 /**
107 * Entity id of referenced table.
108 *
109 * @var int unsigned
110 */
111 public $entity_id;
112 /**
113 * class constructor
114 *
115 * @return civicrm_campaign_group
116 */
117 function __construct() {
118 $this->__table = 'civicrm_campaign_group';
119 parent::__construct();
120 }
121 /**
122 * Returns foreign keys and entity references
123 *
124 * @return array
125 * [CRM_Core_Reference_Interface]
126 */
127 static function getReferenceColumns() {
128 if (!self::$_links) {
129 self::$_links = static ::createReferenceColumns(__CLASS__);
130 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
131 self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
132 }
133 return self::$_links;
134 }
135 /**
136 * Returns all the column names of this table
137 *
138 * @return array
139 */
140 static function &fields() {
141 if (!(self::$_fields)) {
142 self::$_fields = array(
143 'id' => array(
144 'name' => 'id',
145 'type' => CRM_Utils_Type::T_INT,
146 'description' => 'Campaign Group id.',
147 'required' => true,
148 ) ,
149 'campaign_id' => array(
150 'name' => 'campaign_id',
151 'type' => CRM_Utils_Type::T_INT,
152 'description' => 'Foreign key to the activity Campaign.',
153 'required' => true,
154 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
155 'pseudoconstant' => array(
156 'table' => 'civicrm_campaign',
157 'keyColumn' => 'id',
158 'labelColumn' => 'title',
159 )
160 ) ,
161 'group_type' => array(
162 'name' => 'group_type',
163 'type' => CRM_Utils_Type::T_STRING,
164 'title' => ts('Group Type') ,
165 'description' => 'Type of Group.',
166 'maxlength' => 8,
167 'size' => CRM_Utils_Type::EIGHT,
168 'default' => 'NULL',
169 'html' => array(
170 'type' => 'Select',
171 ) ,
172 'pseudoconstant' => array(
173 'callback' => 'CRM_Core_SelectValues::getCampaignGroupTypes',
174 )
175 ) ,
176 'entity_table' => array(
177 'name' => 'entity_table',
178 'type' => CRM_Utils_Type::T_STRING,
179 'title' => ts('Entity Table') ,
180 'description' => 'Name of table where item being referenced is stored.',
181 'maxlength' => 64,
182 'size' => CRM_Utils_Type::BIG,
183 'default' => 'NULL',
184 ) ,
185 'entity_id' => array(
186 'name' => 'entity_id',
187 'type' => CRM_Utils_Type::T_INT,
188 'description' => 'Entity id of referenced table.',
189 'default' => 'NULL',
190 ) ,
191 );
192 }
193 return self::$_fields;
194 }
195 /**
196 * Returns an array containing, for each field, the arary key used for that
197 * field in self::$_fields.
198 *
199 * @return array
200 */
201 static function &fieldKeys() {
202 if (!(self::$_fieldKeys)) {
203 self::$_fieldKeys = array(
204 'id' => 'id',
205 'campaign_id' => 'campaign_id',
206 'group_type' => 'group_type',
207 'entity_table' => 'entity_table',
208 'entity_id' => 'entity_id',
209 );
210 }
211 return self::$_fieldKeys;
212 }
213 /**
214 * Returns the names of this table
215 *
216 * @return string
217 */
218 static function getTableName() {
219 return self::$_tableName;
220 }
221 /**
222 * Returns if this table needs to be logged
223 *
224 * @return boolean
225 */
226 function getLog() {
227 return self::$_log;
228 }
229 /**
230 * Returns the list of fields that can be imported
231 *
232 * @param bool $prefix
233 *
234 * @return array
235 */
236 static function &import($prefix = false) {
237 if (!(self::$_import)) {
238 self::$_import = array();
239 $fields = self::fields();
240 foreach($fields as $name => $field) {
241 if (CRM_Utils_Array::value('import', $field)) {
242 if ($prefix) {
243 self::$_import['campaign_group'] = & $fields[$name];
244 } else {
245 self::$_import[$name] = & $fields[$name];
246 }
247 }
248 }
249 }
250 return self::$_import;
251 }
252 /**
253 * Returns the list of fields that can be exported
254 *
255 * @param bool $prefix
256 *
257 * @return array
258 */
259 static function &export($prefix = false) {
260 if (!(self::$_export)) {
261 self::$_export = array();
262 $fields = self::fields();
263 foreach($fields as $name => $field) {
264 if (CRM_Utils_Array::value('export', $field)) {
265 if ($prefix) {
266 self::$_export['campaign_group'] = & $fields[$name];
267 } else {
268 self::$_export[$name] = & $fields[$name];
269 }
270 }
271 }
272 }
273 return self::$_export;
274 }
275 }