Regen DAOs with new import() / export()
[civicrm-core.git] / CRM / Cxn / DAO / Cxn.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Cxn/Cxn.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:486a0a360a4a9913e94e3879e51300f6)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Cxn_DAO_Cxn extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_cxn';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = false;
69 /**
70 * Connection ID
71 *
72 * @var int unsigned
73 */
74 public $id;
75 /**
76 * Application GUID
77 *
78 * @var string
79 */
80 public $app_guid;
81 /**
82 * Application Metadata (JSON)
83 *
84 * @var text
85 */
86 public $app_meta;
87 /**
88 * Connection GUID
89 *
90 * @var string
91 */
92 public $cxn_guid;
93 /**
94 * Shared secret
95 *
96 * @var text
97 */
98 public $secret;
99 /**
100 * Permissions approved for the service (JSON)
101 *
102 * @var text
103 */
104 public $perm;
105 /**
106 * Options for the service (JSON)
107 *
108 * @var text
109 */
110 public $options;
111 /**
112 * Is connection currently enabled?
113 *
114 * @var boolean
115 */
116 public $is_active;
117 /**
118 * When was the connection was created.
119 *
120 * @var timestamp
121 */
122 public $created_date;
123 /**
124 * When the connection was created or modified.
125 *
126 * @var timestamp
127 */
128 public $modified_date;
129 /**
130 * The last time the application metadata was fetched.
131 *
132 * @var timestamp
133 */
134 public $fetched_date;
135 /**
136 * class constructor
137 *
138 * @return civicrm_cxn
139 */
140 function __construct() {
141 $this->__table = 'civicrm_cxn';
142 parent::__construct();
143 }
144 /**
145 * Returns all the column names of this table
146 *
147 * @return array
148 */
149 static function &fields() {
150 if (!(self::$_fields)) {
151 self::$_fields = array(
152 'id' => array(
153 'name' => 'id',
154 'type' => CRM_Utils_Type::T_INT,
155 'title' => ts('Connection ID') ,
156 'description' => 'Connection ID',
157 'required' => true,
158 ) ,
159 'app_guid' => array(
160 'name' => 'app_guid',
161 'type' => CRM_Utils_Type::T_STRING,
162 'title' => ts('Application GUID') ,
163 'description' => 'Application GUID',
164 'maxlength' => 128,
165 'size' => CRM_Utils_Type::HUGE,
166 ) ,
167 'app_meta' => array(
168 'name' => 'app_meta',
169 'type' => CRM_Utils_Type::T_TEXT,
170 'title' => ts('Application Metadata (JSON)') ,
171 'description' => 'Application Metadata (JSON)',
172 ) ,
173 'cxn_guid' => array(
174 'name' => 'cxn_guid',
175 'type' => CRM_Utils_Type::T_STRING,
176 'title' => ts('Connection GUID') ,
177 'description' => 'Connection GUID',
178 'maxlength' => 128,
179 'size' => CRM_Utils_Type::HUGE,
180 ) ,
181 'secret' => array(
182 'name' => 'secret',
183 'type' => CRM_Utils_Type::T_TEXT,
184 'title' => ts('Secret') ,
185 'description' => 'Shared secret',
186 ) ,
187 'perm' => array(
188 'name' => 'perm',
189 'type' => CRM_Utils_Type::T_TEXT,
190 'title' => ts('Perm') ,
191 'description' => 'Permissions approved for the service (JSON)',
192 ) ,
193 'options' => array(
194 'name' => 'options',
195 'type' => CRM_Utils_Type::T_TEXT,
196 'title' => ts('Options') ,
197 'description' => 'Options for the service (JSON)',
198 ) ,
199 'is_active' => array(
200 'name' => 'is_active',
201 'type' => CRM_Utils_Type::T_BOOLEAN,
202 'title' => ts('Is Active') ,
203 'description' => 'Is connection currently enabled?',
204 'default' => '1',
205 ) ,
206 'created_date' => array(
207 'name' => 'created_date',
208 'type' => CRM_Utils_Type::T_TIMESTAMP,
209 'title' => ts('Created Date') ,
210 'description' => 'When was the connection was created.',
211 'required' => false,
212 'default' => 'NULL',
213 ) ,
214 'modified_date' => array(
215 'name' => 'modified_date',
216 'type' => CRM_Utils_Type::T_TIMESTAMP,
217 'title' => ts('Modified Date') ,
218 'description' => 'When the connection was created or modified.',
219 'required' => false,
220 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
221 ) ,
222 'fetched_date' => array(
223 'name' => 'fetched_date',
224 'type' => CRM_Utils_Type::T_TIMESTAMP,
225 'title' => ts('Fetched Date') ,
226 'description' => 'The last time the application metadata was fetched.',
227 'required' => false,
228 'default' => 'NULL',
229 ) ,
230 );
231 }
232 return self::$_fields;
233 }
234 /**
235 * Returns an array containing, for each field, the arary key used for that
236 * field in self::$_fields.
237 *
238 * @return array
239 */
240 static function &fieldKeys() {
241 if (!(self::$_fieldKeys)) {
242 self::$_fieldKeys = array(
243 'id' => 'id',
244 'app_guid' => 'app_guid',
245 'app_meta' => 'app_meta',
246 'cxn_guid' => 'cxn_guid',
247 'secret' => 'secret',
248 'perm' => 'perm',
249 'options' => 'options',
250 'is_active' => 'is_active',
251 'created_date' => 'created_date',
252 'modified_date' => 'modified_date',
253 'fetched_date' => 'fetched_date',
254 );
255 }
256 return self::$_fieldKeys;
257 }
258 /**
259 * Returns the names of this table
260 *
261 * @return string
262 */
263 static function getTableName() {
264 return self::$_tableName;
265 }
266 /**
267 * Returns if this table needs to be logged
268 *
269 * @return boolean
270 */
271 function getLog() {
272 return self::$_log;
273 }
274 /**
275 * Returns the list of fields that can be imported
276 *
277 * @param bool $prefix
278 *
279 * @return array
280 */
281 static function &import($prefix = false) {
282 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'cxn', $prefix, array());
283 return $r;
284 }
285 /**
286 * Returns the list of fields that can be exported
287 *
288 * @param bool $prefix
289 *
290 * @return array
291 */
292 static function &export($prefix = false) {
293 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'cxn', $prefix, array());
294 return $r;
295 }
296 }