[NFC] Re-generate DAOs
[civicrm-core.git] / CRM / SMS / DAO / Provider.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/SMS/Provider.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:12dc41bf4f9c0eef63e616eec8cf6113)
10 */
11
12 /**
13 * Database access object for the Provider entity.
14 */
15 class CRM_SMS_DAO_Provider extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_sms_provider';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * SMS Provider ID
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Provider internal name points to option_value of option_group sms_provider_name
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Provider name visible to user
47 *
48 * @var string
49 */
50 public $title;
51
52 /**
53 * @var string
54 */
55 public $username;
56
57 /**
58 * @var string
59 */
60 public $password;
61
62 /**
63 * points to value in civicrm_option_value for group sms_api_type
64 *
65 * @var int
66 */
67 public $api_type;
68
69 /**
70 * @var string
71 */
72 public $api_url;
73
74 /**
75 * the api params in xml, http or smtp format
76 *
77 * @var text
78 */
79 public $api_params;
80
81 /**
82 * @var bool
83 */
84 public $is_default;
85
86 /**
87 * @var bool
88 */
89 public $is_active;
90
91 /**
92 * Which Domain is this sms provider for
93 *
94 * @var int
95 */
96 public $domain_id;
97
98 /**
99 * Class constructor.
100 */
101 public function __construct() {
102 $this->__table = 'civicrm_sms_provider';
103 parent::__construct();
104 }
105
106 /**
107 * Returns foreign keys and entity references.
108 *
109 * @return array
110 * [CRM_Core_Reference_Interface]
111 */
112 public static function getReferenceColumns() {
113 if (!isset(Civi::$statics[__CLASS__]['links'])) {
114 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
115 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
116 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
117 }
118 return Civi::$statics[__CLASS__]['links'];
119 }
120
121 /**
122 * Returns all the column names of this table
123 *
124 * @return array
125 */
126 public static function &fields() {
127 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
128 Civi::$statics[__CLASS__]['fields'] = [
129 'id' => [
130 'name' => 'id',
131 'type' => CRM_Utils_Type::T_INT,
132 'title' => ts('SMS Provider ID'),
133 'description' => ts('SMS Provider ID'),
134 'required' => TRUE,
135 'where' => 'civicrm_sms_provider.id',
136 'table_name' => 'civicrm_sms_provider',
137 'entity' => 'Provider',
138 'bao' => 'CRM_SMS_BAO_Provider',
139 'localizable' => 0,
140 ],
141 'name' => [
142 'name' => 'name',
143 'type' => CRM_Utils_Type::T_STRING,
144 'title' => ts('SMS Provider Name'),
145 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
146 'maxlength' => 64,
147 'size' => CRM_Utils_Type::BIG,
148 'where' => 'civicrm_sms_provider.name',
149 'table_name' => 'civicrm_sms_provider',
150 'entity' => 'Provider',
151 'bao' => 'CRM_SMS_BAO_Provider',
152 'localizable' => 0,
153 ],
154 'title' => [
155 'name' => 'title',
156 'type' => CRM_Utils_Type::T_STRING,
157 'title' => ts('SMS Provider Title'),
158 'description' => ts('Provider name visible to user'),
159 'maxlength' => 64,
160 'size' => CRM_Utils_Type::BIG,
161 'where' => 'civicrm_sms_provider.title',
162 'table_name' => 'civicrm_sms_provider',
163 'entity' => 'Provider',
164 'bao' => 'CRM_SMS_BAO_Provider',
165 'localizable' => 0,
166 'html' => [
167 'type' => 'Text',
168 ],
169 ],
170 'username' => [
171 'name' => 'username',
172 'type' => CRM_Utils_Type::T_STRING,
173 'title' => ts('SMS Provider Username'),
174 'maxlength' => 255,
175 'size' => CRM_Utils_Type::HUGE,
176 'where' => 'civicrm_sms_provider.username',
177 'table_name' => 'civicrm_sms_provider',
178 'entity' => 'Provider',
179 'bao' => 'CRM_SMS_BAO_Provider',
180 'localizable' => 0,
181 'html' => [
182 'type' => 'Text',
183 ],
184 ],
185 'password' => [
186 'name' => 'password',
187 'type' => CRM_Utils_Type::T_STRING,
188 'title' => ts('SMS Provider Password'),
189 'maxlength' => 255,
190 'size' => CRM_Utils_Type::HUGE,
191 'where' => 'civicrm_sms_provider.password',
192 'table_name' => 'civicrm_sms_provider',
193 'entity' => 'Provider',
194 'bao' => 'CRM_SMS_BAO_Provider',
195 'localizable' => 0,
196 'html' => [
197 'type' => 'Text',
198 ],
199 ],
200 'api_type' => [
201 'name' => 'api_type',
202 'type' => CRM_Utils_Type::T_INT,
203 'title' => ts('SMS Provider API'),
204 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
205 'required' => TRUE,
206 'where' => 'civicrm_sms_provider.api_type',
207 'table_name' => 'civicrm_sms_provider',
208 'entity' => 'Provider',
209 'bao' => 'CRM_SMS_BAO_Provider',
210 'localizable' => 0,
211 'html' => [
212 'type' => 'Select',
213 ],
214 ],
215 'api_url' => [
216 'name' => 'api_url',
217 'type' => CRM_Utils_Type::T_STRING,
218 'title' => ts('SMS Provider API URL'),
219 'maxlength' => 128,
220 'size' => CRM_Utils_Type::HUGE,
221 'where' => 'civicrm_sms_provider.api_url',
222 'table_name' => 'civicrm_sms_provider',
223 'entity' => 'Provider',
224 'bao' => 'CRM_SMS_BAO_Provider',
225 'localizable' => 0,
226 'html' => [
227 'type' => 'Text',
228 ],
229 ],
230 'api_params' => [
231 'name' => 'api_params',
232 'type' => CRM_Utils_Type::T_TEXT,
233 'title' => ts('SMS Provider API Params'),
234 'description' => ts('the api params in xml, http or smtp format'),
235 'where' => 'civicrm_sms_provider.api_params',
236 'table_name' => 'civicrm_sms_provider',
237 'entity' => 'Provider',
238 'bao' => 'CRM_SMS_BAO_Provider',
239 'localizable' => 0,
240 'html' => [
241 'type' => 'Text',
242 ],
243 ],
244 'is_default' => [
245 'name' => 'is_default',
246 'type' => CRM_Utils_Type::T_BOOLEAN,
247 'title' => ts('SMS Provider is Default?'),
248 'where' => 'civicrm_sms_provider.is_default',
249 'default' => '0',
250 'table_name' => 'civicrm_sms_provider',
251 'entity' => 'Provider',
252 'bao' => 'CRM_SMS_BAO_Provider',
253 'localizable' => 0,
254 'html' => [
255 'type' => 'CheckBox',
256 ],
257 ],
258 'is_active' => [
259 'name' => 'is_active',
260 'type' => CRM_Utils_Type::T_BOOLEAN,
261 'title' => ts('SMS Provider is Active?'),
262 'where' => 'civicrm_sms_provider.is_active',
263 'default' => '0',
264 'table_name' => 'civicrm_sms_provider',
265 'entity' => 'Provider',
266 'bao' => 'CRM_SMS_BAO_Provider',
267 'localizable' => 0,
268 'html' => [
269 'type' => 'CheckBox',
270 ],
271 ],
272 'domain_id' => [
273 'name' => 'domain_id',
274 'type' => CRM_Utils_Type::T_INT,
275 'title' => ts('SMS Domain'),
276 'description' => ts('Which Domain is this sms provider for'),
277 'where' => 'civicrm_sms_provider.domain_id',
278 'table_name' => 'civicrm_sms_provider',
279 'entity' => 'Provider',
280 'bao' => 'CRM_SMS_BAO_Provider',
281 'localizable' => 0,
282 'FKClassName' => 'CRM_Core_DAO_Domain',
283 'pseudoconstant' => [
284 'table' => 'civicrm_domain',
285 'keyColumn' => 'id',
286 'labelColumn' => 'name',
287 ],
288 ],
289 ];
290 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
291 }
292 return Civi::$statics[__CLASS__]['fields'];
293 }
294
295 /**
296 * Return a mapping from field-name to the corresponding key (as used in fields()).
297 *
298 * @return array
299 * Array(string $name => string $uniqueName).
300 */
301 public static function &fieldKeys() {
302 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
303 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
304 }
305 return Civi::$statics[__CLASS__]['fieldKeys'];
306 }
307
308 /**
309 * Returns the names of this table
310 *
311 * @return string
312 */
313 public static function getTableName() {
314 return self::$_tableName;
315 }
316
317 /**
318 * Returns if this table needs to be logged
319 *
320 * @return bool
321 */
322 public function getLog() {
323 return self::$_log;
324 }
325
326 /**
327 * Returns the list of fields that can be imported
328 *
329 * @param bool $prefix
330 *
331 * @return array
332 */
333 public static function &import($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'sms_provider', $prefix, []);
335 return $r;
336 }
337
338 /**
339 * Returns the list of fields that can be exported
340 *
341 * @param bool $prefix
342 *
343 * @return array
344 */
345 public static function &export($prefix = FALSE) {
346 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'sms_provider', $prefix, []);
347 return $r;
348 }
349
350 /**
351 * Returns the list of indices
352 *
353 * @param bool $localize
354 *
355 * @return array
356 */
357 public static function indices($localize = TRUE) {
358 $indices = [];
359 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
360 }
361
362 }