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