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:90ebdb9687fcc28fb71ec5ef15dafc1b)
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',
208 'serialize' => self
::SERIALIZE_JSON
,
210 'is_active' => array(
211 'name' => 'is_active',
212 'type' => CRM_Utils_Type
::T_BOOLEAN
,
213 'title' => ts('Is Active') ,
214 'description' => 'Is connection currently enabled?',
216 'table_name' => 'civicrm_cxn',
218 'bao' => 'CRM_Cxn_BAO_Cxn',
221 'created_date' => array(
222 'name' => 'created_date',
223 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
224 'title' => ts('Created Date') ,
225 'description' => 'When was the connection was created.',
228 'table_name' => 'civicrm_cxn',
230 'bao' => 'CRM_Cxn_BAO_Cxn',
233 'modified_date' => array(
234 'name' => 'modified_date',
235 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
236 'title' => ts('Modified Date') ,
237 'description' => 'When the connection was created or modified.',
239 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
240 'table_name' => 'civicrm_cxn',
242 'bao' => 'CRM_Cxn_BAO_Cxn',
245 'fetched_date' => array(
246 'name' => 'fetched_date',
247 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
248 'title' => ts('Fetched Date') ,
249 'description' => 'The last time the application metadata was fetched.',
252 'table_name' => 'civicrm_cxn',
254 'bao' => 'CRM_Cxn_BAO_Cxn',
258 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
260 return Civi
::$statics[__CLASS__
]['fields'];
263 * Return a mapping from field-name to the corresponding key (as used in fields()).
266 * Array(string $name => string $uniqueName).
268 static function &fieldKeys() {
269 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
270 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
272 return Civi
::$statics[__CLASS__
]['fieldKeys'];
275 * Returns the names of this table
279 static function getTableName() {
280 return self
::$_tableName;
283 * Returns if this table needs to be logged
291 * Returns the list of fields that can be imported
293 * @param bool $prefix
297 static function &import($prefix = false) {
298 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, array());
302 * Returns the list of fields that can be exported
304 * @param bool $prefix
308 static function &export($prefix = false) {
309 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, array());
313 * Returns the list of indices
315 public static function indices($localize = TRUE) {
318 'name' => 'UI_appid',
322 'localizable' => false,
324 'sig' => 'civicrm_cxn::1::app_guid',
326 'UI_keypair_cxnid' => array(
327 'name' => 'UI_keypair_cxnid',
331 'localizable' => false,
333 'sig' => 'civicrm_cxn::1::cxn_guid',
336 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;