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:4c6be1bafb940a9e87e5952364b00fb1)
13 * Database access object for the Cxn entity.
15 class CRM_Cxn_DAO_Cxn
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.6';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_cxn';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
48 * Application Metadata (JSON)
69 * Permissions approved for the service (JSON)
76 * Options for the service (JSON)
83 * Is connection currently enabled?
90 * When was the connection was created.
97 * When the connection was created or modified.
101 public $modified_date;
104 * The last time the application metadata was fetched.
108 public $fetched_date;
113 public function __construct() {
114 $this->__table
= 'civicrm_cxn';
115 parent
::__construct();
119 * Returns localized title of this entity.
121 * @param bool $plural
122 * Whether to return the plural version of the title.
124 public static function getEntityTitle($plural = FALSE) {
125 return $plural ?
ts('Cxns') : ts('Cxn');
129 * Returns all the column names of this table
133 public static function &fields() {
134 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
135 Civi
::$statics[__CLASS__
]['fields'] = [
138 'type' => CRM_Utils_Type
::T_INT
,
139 'title' => ts('Connection ID'),
140 'description' => ts('Connection ID'),
142 'where' => 'civicrm_cxn.id',
143 'table_name' => 'civicrm_cxn',
145 'bao' => 'CRM_Cxn_BAO_Cxn',
150 'name' => 'app_guid',
151 'type' => CRM_Utils_Type
::T_STRING
,
152 'title' => ts('Application GUID'),
153 'description' => ts('Application GUID'),
155 'size' => CRM_Utils_Type
::HUGE
,
156 'where' => 'civicrm_cxn.app_guid',
157 'table_name' => 'civicrm_cxn',
159 'bao' => 'CRM_Cxn_BAO_Cxn',
164 'name' => 'app_meta',
165 'type' => CRM_Utils_Type
::T_TEXT
,
166 'title' => ts('Application Metadata (JSON)'),
167 'description' => ts('Application Metadata (JSON)'),
168 'where' => 'civicrm_cxn.app_meta',
169 'table_name' => 'civicrm_cxn',
171 'bao' => 'CRM_Cxn_BAO_Cxn',
176 'name' => 'cxn_guid',
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Connection GUID'),
179 'description' => ts('Connection GUID'),
181 'size' => CRM_Utils_Type
::HUGE
,
182 'where' => 'civicrm_cxn.cxn_guid',
183 'table_name' => 'civicrm_cxn',
185 'bao' => 'CRM_Cxn_BAO_Cxn',
191 'type' => CRM_Utils_Type
::T_TEXT
,
192 'title' => ts('Secret'),
193 'description' => ts('Shared secret'),
194 'where' => 'civicrm_cxn.secret',
195 'table_name' => 'civicrm_cxn',
197 'bao' => 'CRM_Cxn_BAO_Cxn',
203 'type' => CRM_Utils_Type
::T_TEXT
,
204 'title' => ts('Perm'),
205 'description' => ts('Permissions approved for the service (JSON)'),
206 'where' => 'civicrm_cxn.perm',
207 'table_name' => 'civicrm_cxn',
209 'bao' => 'CRM_Cxn_BAO_Cxn',
215 'type' => CRM_Utils_Type
::T_TEXT
,
216 'title' => ts('Options'),
217 'description' => ts('Options for the service (JSON)'),
218 'where' => 'civicrm_cxn.options',
219 'table_name' => 'civicrm_cxn',
221 'bao' => 'CRM_Cxn_BAO_Cxn',
223 'serialize' => self
::SERIALIZE_JSON
,
227 'name' => 'is_active',
228 'type' => CRM_Utils_Type
::T_BOOLEAN
,
229 'title' => ts('Is Active'),
230 'description' => ts('Is connection currently enabled?'),
231 'where' => 'civicrm_cxn.is_active',
233 'table_name' => 'civicrm_cxn',
235 'bao' => 'CRM_Cxn_BAO_Cxn',
240 'name' => 'created_date',
241 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
242 'title' => ts('Created Date'),
243 'description' => ts('When was the connection was created.'),
245 'where' => 'civicrm_cxn.created_date',
247 'table_name' => 'civicrm_cxn',
249 'bao' => 'CRM_Cxn_BAO_Cxn',
254 'name' => 'modified_date',
255 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
256 'title' => ts('Modified Date'),
257 'description' => ts('When the connection was created or modified.'),
259 'where' => 'civicrm_cxn.modified_date',
260 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
261 'table_name' => 'civicrm_cxn',
263 'bao' => 'CRM_Cxn_BAO_Cxn',
268 'name' => 'fetched_date',
269 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
270 'title' => ts('Fetched Date'),
271 'description' => ts('The last time the application metadata was fetched.'),
273 'where' => 'civicrm_cxn.fetched_date',
275 'table_name' => 'civicrm_cxn',
277 'bao' => 'CRM_Cxn_BAO_Cxn',
282 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
284 return Civi
::$statics[__CLASS__
]['fields'];
288 * Return a mapping from field-name to the corresponding key (as used in fields()).
291 * Array(string $name => string $uniqueName).
293 public static function &fieldKeys() {
294 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
295 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
297 return Civi
::$statics[__CLASS__
]['fieldKeys'];
301 * Returns the names of this table
305 public static function getTableName() {
306 return self
::$_tableName;
310 * Returns if this table needs to be logged
314 public function getLog() {
319 * Returns the list of fields that can be imported
321 * @param bool $prefix
325 public static function &import($prefix = FALSE) {
326 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, []);
331 * Returns the list of fields that can be exported
333 * @param bool $prefix
337 public static function &export($prefix = FALSE) {
338 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, []);
343 * Returns the list of indices
345 * @param bool $localize
349 public static function indices($localize = TRUE) {
352 'name' => 'UI_appid',
356 'localizable' => FALSE,
358 'sig' => 'civicrm_cxn::1::app_guid',
360 'UI_keypair_cxnid' => [
361 'name' => 'UI_keypair_cxnid',
365 'localizable' => FALSE,
367 'sig' => 'civicrm_cxn::1::cxn_guid',
370 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;