3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2015
31 * Generated from xml/schema/CRM/Cxn/Cxn.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Cxn_DAO_Cxn
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_cxn';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
95 * Application Metadata (JSON)
113 * Permissions approved for the service (JSON)
119 * Options for the service (JSON)
125 * Is connection currently enabled?
131 * When was the connection was created.
135 public $created_date;
137 * When the connection was created or modified.
141 public $modified_date;
143 * The last time the application metadata was fetched.
147 public $fetched_date;
151 * @return civicrm_cxn
153 function __construct() {
154 $this->__table
= 'civicrm_cxn';
155 parent
::__construct();
158 * Returns all the column names of this table
162 static function &fields() {
163 if (!(self
::$_fields)) {
164 self
::$_fields = array(
167 'type' => CRM_Utils_Type
::T_INT
,
168 'title' => ts('Connection ID') ,
169 'description' => 'Connection ID',
173 'name' => 'app_guid',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Application GUID') ,
176 'description' => 'Application GUID',
178 'size' => CRM_Utils_Type
::HUGE
,
181 'name' => 'app_meta',
182 'type' => CRM_Utils_Type
::T_TEXT
,
183 'title' => ts('Application Metadata (JSON)') ,
184 'description' => 'Application Metadata (JSON)',
187 'name' => 'cxn_guid',
188 'type' => CRM_Utils_Type
::T_STRING
,
189 'title' => ts('Connection GUID') ,
190 'description' => 'Connection GUID',
192 'size' => CRM_Utils_Type
::HUGE
,
196 'type' => CRM_Utils_Type
::T_TEXT
,
197 'title' => ts('Secret') ,
198 'description' => 'Shared secret',
202 'type' => CRM_Utils_Type
::T_TEXT
,
203 'title' => ts('Perm') ,
204 'description' => 'Permissions approved for the service (JSON)',
208 'type' => CRM_Utils_Type
::T_TEXT
,
209 'title' => ts('Options') ,
210 'description' => 'Options for the service (JSON)',
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?',
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.',
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.',
233 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
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.',
245 return self
::$_fields;
248 * Returns an array containing, for each field, the arary key used for that
249 * field in self::$_fields.
253 static function &fieldKeys() {
254 if (!(self
::$_fieldKeys)) {
255 self
::$_fieldKeys = array(
257 'app_guid' => 'app_guid',
258 'app_meta' => 'app_meta',
259 'cxn_guid' => 'cxn_guid',
260 'secret' => 'secret',
262 'options' => 'options',
263 'is_active' => 'is_active',
264 'created_date' => 'created_date',
265 'modified_date' => 'modified_date',
266 'fetched_date' => 'fetched_date',
269 return self
::$_fieldKeys;
272 * Returns the names of this table
276 static function getTableName() {
277 return self
::$_tableName;
280 * Returns if this table needs to be logged
288 * Returns the list of fields that can be imported
290 * @param bool $prefix
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)) {
301 self
::$_import['cxn'] = & $fields[$name];
303 self
::$_import[$name] = & $fields[$name];
308 return self
::$_import;
311 * Returns the list of fields that can be exported
313 * @param bool $prefix
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)) {
324 self
::$_export['cxn'] = & $fields[$name];
326 self
::$_export[$name] = & $fields[$name];
331 return self
::$_export;