3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Cxn/Cxn.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:72b767c4b9d246ef1efb8b9c7c5b6312)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Cxn_DAO_Cxn constructor.
40 class CRM_Cxn_DAO_Cxn
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_cxn';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
66 * Application Metadata (JSON)
84 * Permissions approved for the service (JSON)
90 * Options for the service (JSON)
96 * Is connection currently enabled?
102 * When was the connection was created.
106 public $created_date;
108 * When the connection was created or modified.
112 public $modified_date;
114 * The last time the application metadata was fetched.
118 public $fetched_date;
122 function __construct() {
123 $this->__table
= 'civicrm_cxn';
124 parent
::__construct();
127 * Returns all the column names of this table
131 static function &fields() {
132 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
133 Civi
::$statics[__CLASS__
]['fields'] = array(
136 'type' => CRM_Utils_Type
::T_INT
,
137 'title' => ts('Connection ID') ,
138 'description' => 'Connection ID',
140 'table_name' => 'civicrm_cxn',
142 'bao' => 'CRM_Cxn_BAO_Cxn',
145 'name' => 'app_guid',
146 'type' => CRM_Utils_Type
::T_STRING
,
147 'title' => ts('Application GUID') ,
148 'description' => 'Application GUID',
150 'size' => CRM_Utils_Type
::HUGE
,
151 'table_name' => 'civicrm_cxn',
153 'bao' => 'CRM_Cxn_BAO_Cxn',
156 'name' => 'app_meta',
157 'type' => CRM_Utils_Type
::T_TEXT
,
158 'title' => ts('Application Metadata (JSON)') ,
159 'description' => 'Application Metadata (JSON)',
160 'table_name' => 'civicrm_cxn',
162 'bao' => 'CRM_Cxn_BAO_Cxn',
165 'name' => 'cxn_guid',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Connection GUID') ,
168 'description' => 'Connection GUID',
170 'size' => CRM_Utils_Type
::HUGE
,
171 'table_name' => 'civicrm_cxn',
173 'bao' => 'CRM_Cxn_BAO_Cxn',
177 'type' => CRM_Utils_Type
::T_TEXT
,
178 'title' => ts('Secret') ,
179 'description' => 'Shared secret',
180 'table_name' => 'civicrm_cxn',
182 'bao' => 'CRM_Cxn_BAO_Cxn',
186 'type' => CRM_Utils_Type
::T_TEXT
,
187 'title' => ts('Perm') ,
188 'description' => 'Permissions approved for the service (JSON)',
189 'table_name' => 'civicrm_cxn',
191 'bao' => 'CRM_Cxn_BAO_Cxn',
195 'type' => CRM_Utils_Type
::T_TEXT
,
196 'title' => ts('Options') ,
197 'description' => 'Options for the service (JSON)',
198 'table_name' => 'civicrm_cxn',
200 'bao' => 'CRM_Cxn_BAO_Cxn',
202 'is_active' => array(
203 'name' => 'is_active',
204 'type' => CRM_Utils_Type
::T_BOOLEAN
,
205 'title' => ts('Is Active') ,
206 'description' => 'Is connection currently enabled?',
208 'table_name' => 'civicrm_cxn',
210 'bao' => 'CRM_Cxn_BAO_Cxn',
212 'created_date' => array(
213 'name' => 'created_date',
214 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
215 'title' => ts('Created Date') ,
216 'description' => 'When was the connection was created.',
219 'table_name' => 'civicrm_cxn',
221 'bao' => 'CRM_Cxn_BAO_Cxn',
223 'modified_date' => array(
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',
234 'fetched_date' => array(
235 'name' => 'fetched_date',
236 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
237 'title' => ts('Fetched Date') ,
238 'description' => 'The last time the application metadata was fetched.',
241 'table_name' => 'civicrm_cxn',
243 'bao' => 'CRM_Cxn_BAO_Cxn',
246 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
248 return Civi
::$statics[__CLASS__
]['fields'];
251 * Return a mapping from field-name to the corresponding key (as used in fields()).
254 * Array(string $name => string $uniqueName).
256 static function &fieldKeys() {
257 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
258 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
260 return Civi
::$statics[__CLASS__
]['fieldKeys'];
263 * Returns the names of this table
267 static function getTableName() {
268 return self
::$_tableName;
271 * Returns if this table needs to be logged
279 * Returns the list of fields that can be imported
281 * @param bool $prefix
285 static function &import($prefix = false) {
286 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cxn', $prefix, array());
290 * Returns the list of fields that can be exported
292 * @param bool $prefix
296 static function &export($prefix = false) {
297 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cxn', $prefix, array());