5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Cxn/Cxn.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:90ebdb9687fcc28fb71ec5ef15dafc1b)
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 static $_tableName = 'civicrm_cxn';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 all the column names of this table
121 public static function &fields() {
122 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
123 Civi
::$statics[__CLASS__
]['fields'] = [
126 'type' => CRM_Utils_Type
::T_INT
,
127 'title' => ts('Connection ID'),
128 'description' => 'Connection ID',
130 'table_name' => 'civicrm_cxn',
132 'bao' => 'CRM_Cxn_BAO_Cxn',
136 'name' => 'app_guid',
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('Application GUID'),
139 'description' => 'Application GUID',
141 'size' => CRM_Utils_Type
::HUGE
,
142 'table_name' => 'civicrm_cxn',
144 'bao' => 'CRM_Cxn_BAO_Cxn',
148 'name' => 'app_meta',
149 'type' => CRM_Utils_Type
::T_TEXT
,
150 'title' => ts('Application Metadata (JSON)'),
151 'description' => 'Application Metadata (JSON)',
152 'table_name' => 'civicrm_cxn',
154 'bao' => 'CRM_Cxn_BAO_Cxn',
158 'name' => 'cxn_guid',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Connection GUID'),
161 'description' => 'Connection GUID',
163 'size' => CRM_Utils_Type
::HUGE
,
164 'table_name' => 'civicrm_cxn',
166 'bao' => 'CRM_Cxn_BAO_Cxn',
171 'type' => CRM_Utils_Type
::T_TEXT
,
172 'title' => ts('Secret'),
173 'description' => 'Shared secret',
174 'table_name' => 'civicrm_cxn',
176 'bao' => 'CRM_Cxn_BAO_Cxn',
181 'type' => CRM_Utils_Type
::T_TEXT
,
182 'title' => ts('Perm'),
183 'description' => 'Permissions approved for the service (JSON)',
184 'table_name' => 'civicrm_cxn',
186 'bao' => 'CRM_Cxn_BAO_Cxn',
191 'type' => CRM_Utils_Type
::T_TEXT
,
192 'title' => ts('Options'),
193 'description' => 'Options for the service (JSON)',
194 'table_name' => 'civicrm_cxn',
196 'bao' => 'CRM_Cxn_BAO_Cxn',
198 'serialize' => self
::SERIALIZE_JSON
,
201 'name' => 'is_active',
202 'type' => CRM_Utils_Type
::T_BOOLEAN
,
203 'title' => ts('Is Active'),
204 'description' => 'Is connection currently enabled?',
206 'table_name' => 'civicrm_cxn',
208 'bao' => 'CRM_Cxn_BAO_Cxn',
212 'name' => 'created_date',
213 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
214 'title' => ts('Created Date'),
215 'description' => 'When was the connection was created.',
218 'table_name' => 'civicrm_cxn',
220 'bao' => 'CRM_Cxn_BAO_Cxn',
224 'name' => 'modified_date',
225 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
226 'title' => ts('Modified Date'),
227 'description' => 'When the connection was created or modified.',
229 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
230 'table_name' => 'civicrm_cxn',
232 'bao' => 'CRM_Cxn_BAO_Cxn',
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.',
242 'table_name' => 'civicrm_cxn',
244 'bao' => 'CRM_Cxn_BAO_Cxn',
248 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
250 return Civi
::$statics[__CLASS__
]['fields'];
254 * Return a mapping from field-name to the corresponding key (as used in fields()).
257 * Array(string $name => string $uniqueName).
259 public static function &fieldKeys() {
260 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
261 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
263 return Civi
::$statics[__CLASS__
]['fieldKeys'];
267 * Returns the names of this table
271 public static function getTableName() {
272 return self
::$_tableName;
276 * Returns if this table needs to be logged
280 public function getLog() {
285 * Returns the list of fields that can be imported
287 * @param bool $prefix
291 public static function &import($prefix = FALSE) {
292 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, []);
297 * Returns the list of fields that can be exported
299 * @param bool $prefix
303 public static function &export($prefix = FALSE) {
304 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, []);
309 * Returns the list of indices
311 * @param bool $localize
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' => [
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;