5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Cxn/Cxn.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:bafb13cb7901c4f15b5348e2bf9a27b5)
13 * Database access object for the Cxn entity.
15 class CRM_Cxn_DAO_Cxn
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_cxn';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
46 * Application Metadata (JSON)
67 * Permissions approved for the service (JSON)
74 * Options for the service (JSON)
81 * Is connection currently enabled?
88 * When was the connection was created.
95 * When the connection was created or modified.
99 public $modified_date;
102 * The last time the application metadata was fetched.
106 public $fetched_date;
111 public function __construct() {
112 $this->__table
= 'civicrm_cxn';
113 parent
::__construct();
117 * Returns localized title of this entity.
119 public static function getEntityTitle() {
124 * Returns all the column names of this table
128 public static function &fields() {
129 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
130 Civi
::$statics[__CLASS__
]['fields'] = [
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Connection ID'),
135 'description' => ts('Connection ID'),
137 'where' => 'civicrm_cxn.id',
138 'table_name' => 'civicrm_cxn',
140 'bao' => 'CRM_Cxn_BAO_Cxn',
145 'name' => 'app_guid',
146 'type' => CRM_Utils_Type
::T_STRING
,
147 'title' => ts('Application GUID'),
148 'description' => ts('Application GUID'),
150 'size' => CRM_Utils_Type
::HUGE
,
151 'where' => 'civicrm_cxn.app_guid',
152 'table_name' => 'civicrm_cxn',
154 'bao' => 'CRM_Cxn_BAO_Cxn',
159 'name' => 'app_meta',
160 'type' => CRM_Utils_Type
::T_TEXT
,
161 'title' => ts('Application Metadata (JSON)'),
162 'description' => ts('Application Metadata (JSON)'),
163 'where' => 'civicrm_cxn.app_meta',
164 'table_name' => 'civicrm_cxn',
166 'bao' => 'CRM_Cxn_BAO_Cxn',
171 'name' => 'cxn_guid',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Connection GUID'),
174 'description' => ts('Connection GUID'),
176 'size' => CRM_Utils_Type
::HUGE
,
177 'where' => 'civicrm_cxn.cxn_guid',
178 'table_name' => 'civicrm_cxn',
180 'bao' => 'CRM_Cxn_BAO_Cxn',
186 'type' => CRM_Utils_Type
::T_TEXT
,
187 'title' => ts('Secret'),
188 'description' => ts('Shared secret'),
189 'where' => 'civicrm_cxn.secret',
190 'table_name' => 'civicrm_cxn',
192 'bao' => 'CRM_Cxn_BAO_Cxn',
198 'type' => CRM_Utils_Type
::T_TEXT
,
199 'title' => ts('Perm'),
200 'description' => ts('Permissions approved for the service (JSON)'),
201 'where' => 'civicrm_cxn.perm',
202 'table_name' => 'civicrm_cxn',
204 'bao' => 'CRM_Cxn_BAO_Cxn',
210 'type' => CRM_Utils_Type
::T_TEXT
,
211 'title' => ts('Options'),
212 'description' => ts('Options for the service (JSON)'),
213 'where' => 'civicrm_cxn.options',
214 'table_name' => 'civicrm_cxn',
216 'bao' => 'CRM_Cxn_BAO_Cxn',
218 'serialize' => self
::SERIALIZE_JSON
,
222 'name' => 'is_active',
223 'type' => CRM_Utils_Type
::T_BOOLEAN
,
224 'title' => ts('Is Active'),
225 'description' => ts('Is connection currently enabled?'),
226 'where' => 'civicrm_cxn.is_active',
228 'table_name' => 'civicrm_cxn',
230 'bao' => 'CRM_Cxn_BAO_Cxn',
235 'name' => 'created_date',
236 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
237 'title' => ts('Created Date'),
238 'description' => ts('When was the connection was created.'),
240 'where' => 'civicrm_cxn.created_date',
242 'table_name' => 'civicrm_cxn',
244 'bao' => 'CRM_Cxn_BAO_Cxn',
249 'name' => 'modified_date',
250 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
251 'title' => ts('Modified Date'),
252 'description' => ts('When the connection was created or modified.'),
254 'where' => 'civicrm_cxn.modified_date',
255 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
256 'table_name' => 'civicrm_cxn',
258 'bao' => 'CRM_Cxn_BAO_Cxn',
263 'name' => 'fetched_date',
264 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
265 'title' => ts('Fetched Date'),
266 'description' => ts('The last time the application metadata was fetched.'),
268 'where' => 'civicrm_cxn.fetched_date',
270 'table_name' => 'civicrm_cxn',
272 'bao' => 'CRM_Cxn_BAO_Cxn',
277 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
279 return Civi
::$statics[__CLASS__
]['fields'];
283 * Return a mapping from field-name to the corresponding key (as used in fields()).
286 * Array(string $name => string $uniqueName).
288 public static function &fieldKeys() {
289 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
290 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
292 return Civi
::$statics[__CLASS__
]['fieldKeys'];
296 * Returns the names of this table
300 public static function getTableName() {
301 return self
::$_tableName;
305 * Returns if this table needs to be logged
309 public function getLog() {
314 * Returns the list of fields that can be imported
316 * @param bool $prefix
320 public static function &import($prefix = FALSE) {
321 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, []);
326 * Returns the list of fields that can be exported
328 * @param bool $prefix
332 public static function &export($prefix = FALSE) {
333 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, []);
338 * Returns the list of indices
340 * @param bool $localize
344 public static function indices($localize = TRUE) {
347 'name' => 'UI_appid',
351 'localizable' => FALSE,
353 'sig' => 'civicrm_cxn::1::app_guid',
355 'UI_keypair_cxnid' => [
356 'name' => 'UI_keypair_cxnid',
360 'localizable' => FALSE,
362 'sig' => 'civicrm_cxn::1::cxn_guid',
365 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;