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