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