Regenerate DAO files
[civicrm-core.git] / CRM / SMS / DAO / Provider.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/SMS/Provider.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e6ca0a57 9 * (GenCodeChecksum:73f7f33374bc59a6251529cd2ba704cf)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Provider entity.
f41f0342 14 */
e501603b 15class 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
4eae8dda
SL
106 /**
107 * Returns foreign keys and entity references.
108 *
109 * @return array
110 * [CRM_Core_Reference_Interface]
111 */
c3fc2621 112 public static function getReferenceColumns() {
4eae8dda 113 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 114 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 115 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
4eae8dda
SL
116 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
117 }
118 return Civi::$statics[__CLASS__]['links'];
119 }
c3fc2621 120
e501603b
TO
121 /**
122 * Returns all the column names of this table
123 *
124 * @return array
125 */
c3fc2621 126 public static function &fields() {
346aaaba 127 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
128 Civi::$statics[__CLASS__]['fields'] = [
129 'id' => [
e501603b
TO
130 'name' => 'id',
131 'type' => CRM_Utils_Type::T_INT,
c3fc2621 132 'title' => ts('SMS Provider ID'),
215b423e 133 'description' => ts('SMS Provider ID'),
c3fc2621 134 'required' => TRUE,
a36434b9 135 'where' => 'civicrm_sms_provider.id',
522a26c9 136 'table_name' => 'civicrm_sms_provider',
137 'entity' => 'Provider',
138 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 139 'localizable' => 0,
c3fc2621
CW
140 ],
141 'name' => [
e501603b
TO
142 'name' => 'name',
143 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 144 'title' => ts('SMS Provider Name'),
215b423e 145 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
e501603b
TO
146 'maxlength' => 64,
147 'size' => CRM_Utils_Type::BIG,
a36434b9 148 'where' => 'civicrm_sms_provider.name',
522a26c9 149 'table_name' => 'civicrm_sms_provider',
150 'entity' => 'Provider',
151 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 152 'localizable' => 0,
c3fc2621
CW
153 ],
154 'title' => [
e501603b
TO
155 'name' => 'title',
156 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 157 'title' => ts('SMS Provider Title'),
215b423e 158 'description' => ts('Provider name visible to user'),
e501603b
TO
159 'maxlength' => 64,
160 'size' => CRM_Utils_Type::BIG,
a36434b9 161 'where' => 'civicrm_sms_provider.title',
522a26c9 162 'table_name' => 'civicrm_sms_provider',
163 'entity' => 'Provider',
164 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 165 'localizable' => 0,
c3fc2621 166 'html' => [
e501603b 167 'type' => 'Text',
c3fc2621
CW
168 ],
169 ],
170 'username' => [
e501603b
TO
171 'name' => 'username',
172 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 173 'title' => ts('SMS Provider Username'),
e501603b
TO
174 'maxlength' => 255,
175 'size' => CRM_Utils_Type::HUGE,
a36434b9 176 'where' => 'civicrm_sms_provider.username',
522a26c9 177 'table_name' => 'civicrm_sms_provider',
178 'entity' => 'Provider',
179 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 180 'localizable' => 0,
c3fc2621 181 'html' => [
e501603b 182 'type' => 'Text',
c3fc2621
CW
183 ],
184 ],
185 'password' => [
e501603b
TO
186 'name' => 'password',
187 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 188 'title' => ts('SMS Provider Password'),
e501603b
TO
189 'maxlength' => 255,
190 'size' => CRM_Utils_Type::HUGE,
a36434b9 191 'where' => 'civicrm_sms_provider.password',
522a26c9 192 'table_name' => 'civicrm_sms_provider',
193 'entity' => 'Provider',
194 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 195 'localizable' => 0,
c3fc2621 196 'html' => [
e501603b 197 'type' => 'Text',
c3fc2621
CW
198 ],
199 ],
200 'api_type' => [
e501603b
TO
201 'name' => 'api_type',
202 'type' => CRM_Utils_Type::T_INT,
c3fc2621 203 'title' => ts('SMS Provider API'),
215b423e 204 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
c3fc2621 205 'required' => TRUE,
a36434b9 206 'where' => 'civicrm_sms_provider.api_type',
522a26c9 207 'table_name' => 'civicrm_sms_provider',
208 'entity' => 'Provider',
209 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 210 'localizable' => 0,
c3fc2621 211 'html' => [
e501603b 212 'type' => 'Select',
c3fc2621
CW
213 ],
214 ],
215 'api_url' => [
e501603b
TO
216 'name' => 'api_url',
217 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 218 'title' => ts('SMS Provider API URL'),
e501603b
TO
219 'maxlength' => 128,
220 'size' => CRM_Utils_Type::HUGE,
a36434b9 221 'where' => 'civicrm_sms_provider.api_url',
522a26c9 222 'table_name' => 'civicrm_sms_provider',
223 'entity' => 'Provider',
224 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 225 'localizable' => 0,
c3fc2621 226 'html' => [
e501603b 227 'type' => 'Text',
c3fc2621
CW
228 ],
229 ],
230 'api_params' => [
e501603b
TO
231 'name' => 'api_params',
232 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 233 'title' => ts('SMS Provider API Params'),
215b423e 234 'description' => ts('the api params in xml, http or smtp format'),
a36434b9 235 'where' => 'civicrm_sms_provider.api_params',
522a26c9 236 'table_name' => 'civicrm_sms_provider',
237 'entity' => 'Provider',
238 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 239 'localizable' => 0,
c3fc2621 240 'html' => [
e501603b 241 'type' => 'Text',
c3fc2621
CW
242 ],
243 ],
244 'is_default' => [
e501603b
TO
245 'name' => 'is_default',
246 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 247 'title' => ts('SMS Provider is Default?'),
a36434b9 248 'where' => 'civicrm_sms_provider.is_default',
45a83e42 249 'default' => '0',
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' => 'CheckBox',
c3fc2621
CW
256 ],
257 ],
258 'is_active' => [
e501603b
TO
259 'name' => 'is_active',
260 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 261 'title' => ts('SMS Provider is Active?'),
a36434b9 262 'where' => 'civicrm_sms_provider.is_active',
45a83e42 263 'default' => '0',
522a26c9 264 'table_name' => 'civicrm_sms_provider',
265 'entity' => 'Provider',
266 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 267 'localizable' => 0,
c3fc2621 268 'html' => [
e501603b 269 'type' => 'CheckBox',
c3fc2621
CW
270 ],
271 ],
272 'domain_id' => [
4eae8dda
SL
273 'name' => 'domain_id',
274 'type' => CRM_Utils_Type::T_INT,
c3fc2621 275 'title' => ts('SMS Domain'),
215b423e 276 'description' => ts('Which Domain is this sms provider for'),
a36434b9 277 'where' => 'civicrm_sms_provider.domain_id',
4eae8dda
SL
278 'table_name' => 'civicrm_sms_provider',
279 'entity' => 'Provider',
280 'bao' => 'CRM_SMS_BAO_Provider',
6a7e5e5d 281 'localizable' => 0,
4eae8dda 282 'FKClassName' => 'CRM_Core_DAO_Domain',
c3fc2621 283 'pseudoconstant' => [
4eae8dda
SL
284 'table' => 'civicrm_domain',
285 'keyColumn' => 'id',
286 'labelColumn' => 'name',
e6ca0a57 287 ],
c3fc2621
CW
288 ],
289 ];
346aaaba 290 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 291 }
346aaaba 292 return Civi::$statics[__CLASS__]['fields'];
e501603b 293 }
c3fc2621 294
e501603b 295 /**
bd8e0b14 296 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
297 *
298 * @return array
bd8e0b14 299 * Array(string $name => string $uniqueName).
e501603b 300 */
c3fc2621 301 public static function &fieldKeys() {
bd8e0b14
TO
302 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
303 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 304 }
bd8e0b14 305 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 306 }
c3fc2621 307
e501603b
TO
308 /**
309 * Returns the names of this table
310 *
311 * @return string
312 */
c3fc2621 313 public static function getTableName() {
e501603b
TO
314 return self::$_tableName;
315 }
c3fc2621 316
e501603b
TO
317 /**
318 * Returns if this table needs to be logged
319 *
c3fc2621 320 * @return bool
e501603b 321 */
c3fc2621 322 public function getLog() {
e501603b
TO
323 return self::$_log;
324 }
c3fc2621 325
e501603b
TO
326 /**
327 * Returns the list of fields that can be imported
328 *
329 * @param bool $prefix
330 *
331 * @return array
332 */
c3fc2621
CW
333 public static function &import($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'sms_provider', $prefix, []);
60808919 335 return $r;
e501603b 336 }
c3fc2621 337
e501603b
TO
338 /**
339 * Returns the list of fields that can be exported
340 *
341 * @param bool $prefix
342 *
343 * @return array
344 */
c3fc2621
CW
345 public static function &export($prefix = FALSE) {
346 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'sms_provider', $prefix, []);
60808919 347 return $r;
e501603b 348 }
c3fc2621 349
e7a6b91a
AS
350 /**
351 * Returns the list of indices
c3fc2621
CW
352 *
353 * @param bool $localize
354 *
355 * @return array
e7a6b91a
AS
356 */
357 public static function indices($localize = TRUE) {
c3fc2621 358 $indices = [];
e7a6b91a
AS
359 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
360 }
c3fc2621 361
e501603b 362}