Merge pull request #9632 from yashodha/CRM-19795
[civicrm-core.git] / CRM / Cxn / DAO / Cxn.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
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. |
13| |
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. |
18| |
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+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Cxn/Cxn.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:486a0a360a4a9913e94e3879e51300f6)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Cxn_DAO_Cxn extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_cxn';
e501603b
TO
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 * Connection ID
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Application GUID
59 *
60 * @var string
61 */
62 public $app_guid;
63 /**
64 * Application Metadata (JSON)
65 *
66 * @var text
67 */
68 public $app_meta;
69 /**
70 * Connection GUID
71 *
72 * @var string
73 */
74 public $cxn_guid;
75 /**
76 * Shared secret
77 *
78 * @var text
79 */
80 public $secret;
81 /**
82 * Permissions approved for the service (JSON)
83 *
84 * @var text
85 */
86 public $perm;
87 /**
88 * Options for the service (JSON)
89 *
90 * @var text
91 */
92 public $options;
93 /**
94 * Is connection currently enabled?
95 *
96 * @var boolean
97 */
98 public $is_active;
99 /**
100 * When was the connection was created.
101 *
102 * @var timestamp
103 */
104 public $created_date;
105 /**
106 * When the connection was created or modified.
107 *
108 * @var timestamp
109 */
110 public $modified_date;
111 /**
112 * The last time the application metadata was fetched.
113 *
114 * @var timestamp
115 */
116 public $fetched_date;
117 /**
118 * class constructor
119 *
120 * @return civicrm_cxn
121 */
122 function __construct() {
123 $this->__table = 'civicrm_cxn';
124 parent::__construct();
125 }
126 /**
127 * Returns all the column names of this table
128 *
129 * @return array
130 */
131 static function &fields() {
346aaaba
TO
132 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
133 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
134 'id' => array(
135 'name' => 'id',
136 'type' => CRM_Utils_Type::T_INT,
137 'title' => ts('Connection ID') ,
138 'description' => 'Connection ID',
139 'required' => true,
140 ) ,
141 'app_guid' => array(
142 'name' => 'app_guid',
143 'type' => CRM_Utils_Type::T_STRING,
144 'title' => ts('Application GUID') ,
145 'description' => 'Application GUID',
146 'maxlength' => 128,
147 'size' => CRM_Utils_Type::HUGE,
148 ) ,
149 'app_meta' => array(
150 'name' => 'app_meta',
151 'type' => CRM_Utils_Type::T_TEXT,
152 'title' => ts('Application Metadata (JSON)') ,
153 'description' => 'Application Metadata (JSON)',
154 ) ,
155 'cxn_guid' => array(
156 'name' => 'cxn_guid',
157 'type' => CRM_Utils_Type::T_STRING,
158 'title' => ts('Connection GUID') ,
159 'description' => 'Connection GUID',
160 'maxlength' => 128,
161 'size' => CRM_Utils_Type::HUGE,
162 ) ,
163 'secret' => array(
164 'name' => 'secret',
165 'type' => CRM_Utils_Type::T_TEXT,
166 'title' => ts('Secret') ,
167 'description' => 'Shared secret',
168 ) ,
169 'perm' => array(
170 'name' => 'perm',
171 'type' => CRM_Utils_Type::T_TEXT,
172 'title' => ts('Perm') ,
173 'description' => 'Permissions approved for the service (JSON)',
174 ) ,
175 'options' => array(
176 'name' => 'options',
177 'type' => CRM_Utils_Type::T_TEXT,
178 'title' => ts('Options') ,
179 'description' => 'Options for the service (JSON)',
180 ) ,
181 'is_active' => array(
182 'name' => 'is_active',
183 'type' => CRM_Utils_Type::T_BOOLEAN,
184 'title' => ts('Is Active') ,
185 'description' => 'Is connection currently enabled?',
186 'default' => '1',
187 ) ,
188 'created_date' => array(
189 'name' => 'created_date',
190 'type' => CRM_Utils_Type::T_TIMESTAMP,
191 'title' => ts('Created Date') ,
192 'description' => 'When was the connection was created.',
193 'required' => false,
194 'default' => 'NULL',
195 ) ,
196 'modified_date' => array(
197 'name' => 'modified_date',
198 'type' => CRM_Utils_Type::T_TIMESTAMP,
199 'title' => ts('Modified Date') ,
200 'description' => 'When the connection was created or modified.',
201 'required' => false,
202 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
203 ) ,
204 'fetched_date' => array(
205 'name' => 'fetched_date',
206 'type' => CRM_Utils_Type::T_TIMESTAMP,
207 'title' => ts('Fetched Date') ,
208 'description' => 'The last time the application metadata was fetched.',
209 'required' => false,
210 'default' => 'NULL',
211 ) ,
212 );
346aaaba 213 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 214 }
346aaaba 215 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
216 }
217 /**
bd8e0b14 218 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
219 *
220 * @return array
bd8e0b14 221 * Array(string $name => string $uniqueName).
e501603b
TO
222 */
223 static function &fieldKeys() {
bd8e0b14
TO
224 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
225 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 226 }
bd8e0b14 227 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
228 }
229 /**
230 * Returns the names of this table
231 *
232 * @return string
233 */
234 static function getTableName() {
235 return self::$_tableName;
236 }
237 /**
238 * Returns if this table needs to be logged
239 *
240 * @return boolean
241 */
242 function getLog() {
243 return self::$_log;
244 }
245 /**
246 * Returns the list of fields that can be imported
247 *
248 * @param bool $prefix
249 *
250 * @return array
251 */
252 static function &import($prefix = false) {
60808919
TO
253 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'cxn', $prefix, array());
254 return $r;
e501603b
TO
255 }
256 /**
257 * Returns the list of fields that can be exported
258 *
259 * @param bool $prefix
260 *
261 * @return array
262 */
263 static function &export($prefix = false) {
60808919
TO
264 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'cxn', $prefix, array());
265 return $r;
e501603b
TO
266 }
267}