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