commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Cxn / DAO / Cxn.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/Cxn/Cxn.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_Cxn_DAO_Cxn extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_cxn';
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 * Connection ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Application GUID
90 *
91 * @var string
92 */
93 public $app_guid;
94 /**
95 * Application Metadata (JSON)
96 *
97 * @var text
98 */
99 public $app_meta;
100 /**
101 * Connection GUID
102 *
103 * @var string
104 */
105 public $cxn_guid;
106 /**
107 * Shared secret
108 *
109 * @var text
110 */
111 public $secret;
112 /**
113 * Permissions approved for the service (JSON)
114 *
115 * @var text
116 */
117 public $perm;
118 /**
119 * Options for the service (JSON)
120 *
121 * @var text
122 */
123 public $options;
124 /**
125 * Is connection currently enabled?
126 *
127 * @var boolean
128 */
129 public $is_active;
130 /**
131 * When was the connection was created.
132 *
133 * @var timestamp
134 */
135 public $created_date;
136 /**
137 * When the connection was created or modified.
138 *
139 * @var timestamp
140 */
141 public $modified_date;
142 /**
143 * The last time the application metadata was fetched.
144 *
145 * @var timestamp
146 */
147 public $fetched_date;
148 /**
149 * class constructor
150 *
151 * @return civicrm_cxn
152 */
153 function __construct() {
154 $this->__table = 'civicrm_cxn';
155 parent::__construct();
156 }
157 /**
158 * Returns all the column names of this table
159 *
160 * @return array
161 */
162 static function &fields() {
163 if (!(self::$_fields)) {
164 self::$_fields = array(
165 'id' => array(
166 'name' => 'id',
167 'type' => CRM_Utils_Type::T_INT,
168 'title' => ts('Connection ID') ,
169 'description' => 'Connection ID',
170 'required' => true,
171 ) ,
172 'app_guid' => array(
173 'name' => 'app_guid',
174 'type' => CRM_Utils_Type::T_STRING,
175 'title' => ts('Application GUID') ,
176 'description' => 'Application GUID',
177 'maxlength' => 128,
178 'size' => CRM_Utils_Type::HUGE,
179 ) ,
180 'app_meta' => array(
181 'name' => 'app_meta',
182 'type' => CRM_Utils_Type::T_TEXT,
183 'title' => ts('Application Metadata (JSON)') ,
184 'description' => 'Application Metadata (JSON)',
185 ) ,
186 'cxn_guid' => array(
187 'name' => 'cxn_guid',
188 'type' => CRM_Utils_Type::T_STRING,
189 'title' => ts('Connection GUID') ,
190 'description' => 'Connection GUID',
191 'maxlength' => 128,
192 'size' => CRM_Utils_Type::HUGE,
193 ) ,
194 'secret' => array(
195 'name' => 'secret',
196 'type' => CRM_Utils_Type::T_TEXT,
197 'title' => ts('Secret') ,
198 'description' => 'Shared secret',
199 ) ,
200 'perm' => array(
201 'name' => 'perm',
202 'type' => CRM_Utils_Type::T_TEXT,
203 'title' => ts('Perm') ,
204 'description' => 'Permissions approved for the service (JSON)',
205 ) ,
206 'options' => array(
207 'name' => 'options',
208 'type' => CRM_Utils_Type::T_TEXT,
209 'title' => ts('Options') ,
210 'description' => 'Options for the service (JSON)',
211 ) ,
212 'is_active' => array(
213 'name' => 'is_active',
214 'type' => CRM_Utils_Type::T_BOOLEAN,
215 'title' => ts('Is Active') ,
216 'description' => 'Is connection currently enabled?',
217 'default' => '1',
218 ) ,
219 'created_date' => array(
220 'name' => 'created_date',
221 'type' => CRM_Utils_Type::T_TIMESTAMP,
222 'title' => ts('Created Date') ,
223 'description' => 'When was the connection was created.',
224 'required' => false,
225 'default' => 'NULL',
226 ) ,
227 'modified_date' => array(
228 'name' => 'modified_date',
229 'type' => CRM_Utils_Type::T_TIMESTAMP,
230 'title' => ts('Modified Date') ,
231 'description' => 'When the connection was created or modified.',
232 'required' => false,
233 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
234 ) ,
235 'fetched_date' => array(
236 'name' => 'fetched_date',
237 'type' => CRM_Utils_Type::T_TIMESTAMP,
238 'title' => ts('Fetched Date') ,
239 'description' => 'The last time the application metadata was fetched.',
240 'required' => false,
241 'default' => 'NULL',
242 ) ,
243 );
244 }
245 return self::$_fields;
246 }
247 /**
248 * Returns an array containing, for each field, the arary key used for that
249 * field in self::$_fields.
250 *
251 * @return array
252 */
253 static function &fieldKeys() {
254 if (!(self::$_fieldKeys)) {
255 self::$_fieldKeys = array(
256 'id' => 'id',
257 'app_guid' => 'app_guid',
258 'app_meta' => 'app_meta',
259 'cxn_guid' => 'cxn_guid',
260 'secret' => 'secret',
261 'perm' => 'perm',
262 'options' => 'options',
263 'is_active' => 'is_active',
264 'created_date' => 'created_date',
265 'modified_date' => 'modified_date',
266 'fetched_date' => 'fetched_date',
267 );
268 }
269 return self::$_fieldKeys;
270 }
271 /**
272 * Returns the names of this table
273 *
274 * @return string
275 */
276 static function getTableName() {
277 return self::$_tableName;
278 }
279 /**
280 * Returns if this table needs to be logged
281 *
282 * @return boolean
283 */
284 function getLog() {
285 return self::$_log;
286 }
287 /**
288 * Returns the list of fields that can be imported
289 *
290 * @param bool $prefix
291 *
292 * @return array
293 */
294 static function &import($prefix = false) {
295 if (!(self::$_import)) {
296 self::$_import = array();
297 $fields = self::fields();
298 foreach($fields as $name => $field) {
299 if (CRM_Utils_Array::value('import', $field)) {
300 if ($prefix) {
301 self::$_import['cxn'] = & $fields[$name];
302 } else {
303 self::$_import[$name] = & $fields[$name];
304 }
305 }
306 }
307 }
308 return self::$_import;
309 }
310 /**
311 * Returns the list of fields that can be exported
312 *
313 * @param bool $prefix
314 *
315 * @return array
316 */
317 static function &export($prefix = false) {
318 if (!(self::$_export)) {
319 self::$_export = array();
320 $fields = self::fields();
321 foreach($fields as $name => $field) {
322 if (CRM_Utils_Array::value('export', $field)) {
323 if ($prefix) {
324 self::$_export['cxn'] = & $fields[$name];
325 } else {
326 self::$_export[$name] = & $fields[$name];
327 }
328 }
329 }
330 }
331 return self::$_export;
332 }
333 }