3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Cxn/Cxn.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:7837c80596c2e6d8682a48cffcb6a4d3)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Cxn_DAO_Cxn constructor.
40 class CRM_Cxn_DAO_Cxn
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_cxn';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
66 * Application Metadata (JSON)
84 * Permissions approved for the service (JSON)
90 * Options for the service (JSON)
96 * Is connection currently enabled?
102 * When was the connection was created.
106 public $created_date;
108 * When the connection was created or modified.
112 public $modified_date;
114 * The last time the application metadata was fetched.
118 public $fetched_date;
122 function __construct() {
123 $this->__table
= 'civicrm_cxn';
124 parent
::__construct();
127 * Returns all the column names of this table
131 static function &fields() {
132 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
133 Civi
::$statics[__CLASS__
]['fields'] = array(
136 'type' => CRM_Utils_Type
::T_INT
,
137 'title' => ts('Connection ID') ,
138 'description' => 'Connection ID',
140 'table_name' => 'civicrm_cxn',
142 'bao' => 'CRM_Cxn_BAO_Cxn',
146 'name' => 'app_guid',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Application GUID') ,
149 'description' => 'Application GUID',
151 'size' => CRM_Utils_Type
::HUGE
,
152 'table_name' => 'civicrm_cxn',
154 'bao' => 'CRM_Cxn_BAO_Cxn',
158 'name' => 'app_meta',
159 'type' => CRM_Utils_Type
::T_TEXT
,
160 'title' => ts('Application Metadata (JSON)') ,
161 'description' => 'Application Metadata (JSON)',
162 'table_name' => 'civicrm_cxn',
164 'bao' => 'CRM_Cxn_BAO_Cxn',
168 'name' => 'cxn_guid',
169 'type' => CRM_Utils_Type
::T_STRING
,
170 'title' => ts('Connection GUID') ,
171 'description' => 'Connection GUID',
173 'size' => CRM_Utils_Type
::HUGE
,
174 'table_name' => 'civicrm_cxn',
176 'bao' => 'CRM_Cxn_BAO_Cxn',
181 'type' => CRM_Utils_Type
::T_TEXT
,
182 'title' => ts('Secret') ,
183 'description' => 'Shared secret',
184 'table_name' => 'civicrm_cxn',
186 'bao' => 'CRM_Cxn_BAO_Cxn',
191 'type' => CRM_Utils_Type
::T_TEXT
,
192 'title' => ts('Perm') ,
193 'description' => 'Permissions approved for the service (JSON)',
194 'table_name' => 'civicrm_cxn',
196 'bao' => 'CRM_Cxn_BAO_Cxn',
201 'type' => CRM_Utils_Type
::T_TEXT
,
202 'title' => ts('Options') ,
203 'description' => 'Options for the service (JSON)',
204 'table_name' => 'civicrm_cxn',
206 'bao' => 'CRM_Cxn_BAO_Cxn',
209 'is_active' => array(
210 'name' => 'is_active',
211 'type' => CRM_Utils_Type
::T_BOOLEAN
,
212 'title' => ts('Is Active') ,
213 'description' => 'Is connection currently enabled?',
215 'table_name' => 'civicrm_cxn',
217 'bao' => 'CRM_Cxn_BAO_Cxn',
220 'created_date' => array(
221 'name' => 'created_date',
222 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
223 'title' => ts('Created Date') ,
224 'description' => 'When was the connection was created.',
227 'table_name' => 'civicrm_cxn',
229 'bao' => 'CRM_Cxn_BAO_Cxn',
232 'modified_date' => array(
233 'name' => 'modified_date',
234 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
235 'title' => ts('Modified Date') ,
236 'description' => 'When the connection was created or modified.',
238 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
239 'table_name' => 'civicrm_cxn',
241 'bao' => 'CRM_Cxn_BAO_Cxn',
244 'fetched_date' => array(
245 'name' => 'fetched_date',
246 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
247 'title' => ts('Fetched Date') ,
248 'description' => 'The last time the application metadata was fetched.',
251 'table_name' => 'civicrm_cxn',
253 'bao' => 'CRM_Cxn_BAO_Cxn',
257 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
259 return Civi
::$statics[__CLASS__
]['fields'];
262 * Return a mapping from field-name to the corresponding key (as used in fields()).
265 * Array(string $name => string $uniqueName).
267 static function &fieldKeys() {
268 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
269 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
271 return Civi
::$statics[__CLASS__
]['fieldKeys'];
274 * Returns the names of this table
278 static function getTableName() {
279 return self
::$_tableName;
282 * Returns if this table needs to be logged
290 * Returns the list of fields that can be imported
292 * @param bool $prefix
296 static function &import($prefix = false) {
297 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, array());
301 * Returns the list of fields that can be exported
303 * @param bool $prefix
307 static function &export($prefix = false) {
308 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, array());
312 * Returns the list of indices
314 public static function indices($localize = TRUE) {
317 'name' => 'UI_appid',
321 'localizable' => false,
323 'sig' => 'civicrm_cxn::1::app_guid',
325 'UI_keypair_cxnid' => array(
326 'name' => 'UI_keypair_cxnid',
330 'localizable' => false,
332 'sig' => 'civicrm_cxn::1::cxn_guid',
335 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;