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:efa483cd4f17b2ff7c7444dd888b2369)
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',
144 'name' => 'app_guid',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Application GUID'),
147 'description' => ts('Application GUID'),
149 'size' => CRM_Utils_Type
::HUGE
,
150 'where' => 'civicrm_cxn.app_guid',
151 'table_name' => 'civicrm_cxn',
153 'bao' => 'CRM_Cxn_BAO_Cxn',
157 'name' => 'app_meta',
158 'type' => CRM_Utils_Type
::T_TEXT
,
159 'title' => ts('Application Metadata (JSON)'),
160 'description' => ts('Application Metadata (JSON)'),
161 'where' => 'civicrm_cxn.app_meta',
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' => ts('Connection GUID'),
173 'size' => CRM_Utils_Type
::HUGE
,
174 'where' => 'civicrm_cxn.cxn_guid',
175 'table_name' => 'civicrm_cxn',
177 'bao' => 'CRM_Cxn_BAO_Cxn',
182 'type' => CRM_Utils_Type
::T_TEXT
,
183 'title' => ts('Secret'),
184 'description' => ts('Shared secret'),
185 'where' => 'civicrm_cxn.secret',
186 'table_name' => 'civicrm_cxn',
188 'bao' => 'CRM_Cxn_BAO_Cxn',
193 'type' => CRM_Utils_Type
::T_TEXT
,
194 'title' => ts('Perm'),
195 'description' => ts('Permissions approved for the service (JSON)'),
196 'where' => 'civicrm_cxn.perm',
197 'table_name' => 'civicrm_cxn',
199 'bao' => 'CRM_Cxn_BAO_Cxn',
204 'type' => CRM_Utils_Type
::T_TEXT
,
205 'title' => ts('Options'),
206 'description' => ts('Options for the service (JSON)'),
207 'where' => 'civicrm_cxn.options',
208 'table_name' => 'civicrm_cxn',
210 'bao' => 'CRM_Cxn_BAO_Cxn',
212 'serialize' => self
::SERIALIZE_JSON
,
215 'name' => 'is_active',
216 'type' => CRM_Utils_Type
::T_BOOLEAN
,
217 'title' => ts('Is Active'),
218 'description' => ts('Is connection currently enabled?'),
219 'where' => 'civicrm_cxn.is_active',
221 'table_name' => 'civicrm_cxn',
223 'bao' => 'CRM_Cxn_BAO_Cxn',
227 'name' => 'created_date',
228 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
229 'title' => ts('Created Date'),
230 'description' => ts('When was the connection was created.'),
232 'where' => 'civicrm_cxn.created_date',
234 'table_name' => 'civicrm_cxn',
236 'bao' => 'CRM_Cxn_BAO_Cxn',
240 'name' => 'modified_date',
241 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
242 'title' => ts('Modified Date'),
243 'description' => ts('When the connection was created or modified.'),
245 'where' => 'civicrm_cxn.modified_date',
246 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
247 'table_name' => 'civicrm_cxn',
249 'bao' => 'CRM_Cxn_BAO_Cxn',
253 'name' => 'fetched_date',
254 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
255 'title' => ts('Fetched Date'),
256 'description' => ts('The last time the application metadata was fetched.'),
258 'where' => 'civicrm_cxn.fetched_date',
260 'table_name' => 'civicrm_cxn',
262 'bao' => 'CRM_Cxn_BAO_Cxn',
266 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
268 return Civi
::$statics[__CLASS__
]['fields'];
272 * Return a mapping from field-name to the corresponding key (as used in fields()).
275 * Array(string $name => string $uniqueName).
277 public static function &fieldKeys() {
278 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
279 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
281 return Civi
::$statics[__CLASS__
]['fieldKeys'];
285 * Returns the names of this table
289 public static function getTableName() {
290 return self
::$_tableName;
294 * Returns if this table needs to be logged
298 public function getLog() {
303 * Returns the list of fields that can be imported
305 * @param bool $prefix
309 public static function &import($prefix = FALSE) {
310 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, []);
315 * Returns the list of fields that can be exported
317 * @param bool $prefix
321 public static function &export($prefix = FALSE) {
322 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, []);
327 * Returns the list of indices
329 * @param bool $localize
333 public static function indices($localize = TRUE) {
336 'name' => 'UI_appid',
340 'localizable' => FALSE,
342 'sig' => 'civicrm_cxn::1::app_guid',
344 'UI_keypair_cxnid' => [
345 'name' => 'UI_keypair_cxnid',
349 'localizable' => FALSE,
351 'sig' => 'civicrm_cxn::1::cxn_guid',
354 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;