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:f61b008692885b08cacabc147424ba52)
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 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' => ts('Connection ID'),
130 'where' => 'civicrm_cxn.id',
131 'table_name' => 'civicrm_cxn',
133 'bao' => 'CRM_Cxn_BAO_Cxn',
137 'name' => 'app_guid',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Application GUID'),
140 'description' => ts('Application GUID'),
142 'size' => CRM_Utils_Type
::HUGE
,
143 'where' => 'civicrm_cxn.app_guid',
144 'table_name' => 'civicrm_cxn',
146 'bao' => 'CRM_Cxn_BAO_Cxn',
150 'name' => 'app_meta',
151 'type' => CRM_Utils_Type
::T_TEXT
,
152 'title' => ts('Application Metadata (JSON)'),
153 'description' => ts('Application Metadata (JSON)'),
154 'where' => 'civicrm_cxn.app_meta',
155 'table_name' => 'civicrm_cxn',
157 'bao' => 'CRM_Cxn_BAO_Cxn',
161 'name' => 'cxn_guid',
162 'type' => CRM_Utils_Type
::T_STRING
,
163 'title' => ts('Connection GUID'),
164 'description' => ts('Connection GUID'),
166 'size' => CRM_Utils_Type
::HUGE
,
167 'where' => 'civicrm_cxn.cxn_guid',
168 'table_name' => 'civicrm_cxn',
170 'bao' => 'CRM_Cxn_BAO_Cxn',
175 'type' => CRM_Utils_Type
::T_TEXT
,
176 'title' => ts('Secret'),
177 'description' => ts('Shared secret'),
178 'where' => 'civicrm_cxn.secret',
179 'table_name' => 'civicrm_cxn',
181 'bao' => 'CRM_Cxn_BAO_Cxn',
186 'type' => CRM_Utils_Type
::T_TEXT
,
187 'title' => ts('Perm'),
188 'description' => ts('Permissions approved for the service (JSON)'),
189 'where' => 'civicrm_cxn.perm',
190 'table_name' => 'civicrm_cxn',
192 'bao' => 'CRM_Cxn_BAO_Cxn',
197 'type' => CRM_Utils_Type
::T_TEXT
,
198 'title' => ts('Options'),
199 'description' => ts('Options for the service (JSON)'),
200 'where' => 'civicrm_cxn.options',
201 'table_name' => 'civicrm_cxn',
203 'bao' => 'CRM_Cxn_BAO_Cxn',
205 'serialize' => self
::SERIALIZE_JSON
,
208 'name' => 'is_active',
209 'type' => CRM_Utils_Type
::T_BOOLEAN
,
210 'title' => ts('Is Active'),
211 'description' => ts('Is connection currently enabled?'),
212 'where' => 'civicrm_cxn.is_active',
214 'table_name' => 'civicrm_cxn',
216 'bao' => 'CRM_Cxn_BAO_Cxn',
220 'name' => 'created_date',
221 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
222 'title' => ts('Created Date'),
223 'description' => ts('When was the connection was created.'),
225 'where' => 'civicrm_cxn.created_date',
227 'table_name' => 'civicrm_cxn',
229 'bao' => 'CRM_Cxn_BAO_Cxn',
233 'name' => 'modified_date',
234 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
235 'title' => ts('Modified Date'),
236 'description' => ts('When the connection was created or modified.'),
238 'where' => 'civicrm_cxn.modified_date',
239 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
240 'table_name' => 'civicrm_cxn',
242 'bao' => 'CRM_Cxn_BAO_Cxn',
246 'name' => 'fetched_date',
247 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
248 'title' => ts('Fetched Date'),
249 'description' => ts('The last time the application metadata was fetched.'),
251 'where' => 'civicrm_cxn.fetched_date',
253 'table_name' => 'civicrm_cxn',
255 'bao' => 'CRM_Cxn_BAO_Cxn',
259 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
261 return Civi
::$statics[__CLASS__
]['fields'];
265 * Return a mapping from field-name to the corresponding key (as used in fields()).
268 * Array(string $name => string $uniqueName).
270 public static function &fieldKeys() {
271 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
272 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
274 return Civi
::$statics[__CLASS__
]['fieldKeys'];
278 * Returns the names of this table
282 public static function getTableName() {
283 return self
::$_tableName;
287 * Returns if this table needs to be logged
291 public function getLog() {
296 * Returns the list of fields that can be imported
298 * @param bool $prefix
302 public static function &import($prefix = FALSE) {
303 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, []);
308 * Returns the list of fields that can be exported
310 * @param bool $prefix
314 public static function &export($prefix = FALSE) {
315 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, []);
320 * Returns the list of indices
322 * @param bool $localize
326 public static function indices($localize = TRUE) {
329 'name' => 'UI_appid',
333 'localizable' => FALSE,
335 'sig' => 'civicrm_cxn::1::app_guid',
337 'UI_keypair_cxnid' => [
338 'name' => 'UI_keypair_cxnid',
342 'localizable' => FALSE,
344 'sig' => 'civicrm_cxn::1::cxn_guid',
347 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;