5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/SMS/Provider.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0fc3229e1bb7ff0e9203e6c5c7ba3d6a)
13 * Database access object for the Provider entity.
15 class CRM_SMS_DAO_Provider
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_sms_provider';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Provider internal name points to option_value of option_group sms_provider_name
46 * (SQL type: varchar(64))
47 * Note that values will be retrieved from the database as a string.
52 * Provider name visible to user
55 * (SQL type: varchar(64))
56 * Note that values will be retrieved from the database as a string.
62 * (SQL type: varchar(255))
63 * Note that values will be retrieved from the database as a string.
69 * (SQL type: varchar(255))
70 * Note that values will be retrieved from the database as a string.
75 * points to value in civicrm_option_value for group sms_api_type
78 * (SQL type: int unsigned)
79 * Note that values will be retrieved from the database as a string.
85 * (SQL type: varchar(128))
86 * Note that values will be retrieved from the database as a string.
91 * the api params in xml, http or smtp format
95 * Note that values will be retrieved from the database as a string.
100 * @var bool|string|null
101 * (SQL type: tinyint)
102 * Note that values will be retrieved from the database as a string.
107 * @var bool|string|null
108 * (SQL type: tinyint)
109 * Note that values will be retrieved from the database as a string.
114 * Which Domain is this sms provider for
116 * @var int|string|null
117 * (SQL type: int unsigned)
118 * Note that values will be retrieved from the database as a string.
125 public function __construct() {
126 $this->__table
= 'civicrm_sms_provider';
127 parent
::__construct();
131 * Returns localized title of this entity.
133 * @param bool $plural
134 * Whether to return the plural version of the title.
136 public static function getEntityTitle($plural = FALSE) {
137 return $plural ?
ts('Providers') : ts('Provider');
141 * Returns foreign keys and entity references.
144 * [CRM_Core_Reference_Interface]
146 public static function getReferenceColumns() {
147 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
148 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
149 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
150 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
152 return Civi
::$statics[__CLASS__
]['links'];
156 * Returns all the column names of this table
160 public static function &fields() {
161 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
162 Civi
::$statics[__CLASS__
]['fields'] = [
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('SMS Provider ID'),
167 'description' => ts('SMS Provider ID'),
169 'where' => 'civicrm_sms_provider.id',
170 'table_name' => 'civicrm_sms_provider',
171 'entity' => 'Provider',
172 'bao' => 'CRM_SMS_BAO_Provider',
182 'type' => CRM_Utils_Type
::T_STRING
,
183 'title' => ts('SMS Provider Name'),
184 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
186 'size' => CRM_Utils_Type
::BIG
,
187 'where' => 'civicrm_sms_provider.name',
188 'table_name' => 'civicrm_sms_provider',
189 'entity' => 'Provider',
190 'bao' => 'CRM_SMS_BAO_Provider',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('SMS Provider Title'),
198 'description' => ts('Provider name visible to user'),
200 'size' => CRM_Utils_Type
::BIG
,
201 'where' => 'civicrm_sms_provider.title',
202 'table_name' => 'civicrm_sms_provider',
203 'entity' => 'Provider',
204 'bao' => 'CRM_SMS_BAO_Provider',
212 'name' => 'username',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('SMS Provider Username'),
216 'size' => CRM_Utils_Type
::HUGE
,
217 'where' => 'civicrm_sms_provider.username',
218 'table_name' => 'civicrm_sms_provider',
219 'entity' => 'Provider',
220 'bao' => 'CRM_SMS_BAO_Provider',
228 'name' => 'password',
229 'type' => CRM_Utils_Type
::T_STRING
,
230 'title' => ts('SMS Provider Password'),
232 'size' => CRM_Utils_Type
::HUGE
,
233 'where' => 'civicrm_sms_provider.password',
234 'table_name' => 'civicrm_sms_provider',
235 'entity' => 'Provider',
236 'bao' => 'CRM_SMS_BAO_Provider',
244 'name' => 'api_type',
245 'type' => CRM_Utils_Type
::T_INT
,
246 'title' => ts('SMS Provider API'),
247 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
249 'where' => 'civicrm_sms_provider.api_type',
250 'table_name' => 'civicrm_sms_provider',
251 'entity' => 'Provider',
252 'bao' => 'CRM_SMS_BAO_Provider',
257 'pseudoconstant' => [
258 'optionGroupName' => 'sms_api_type',
259 'optionEditPath' => 'civicrm/admin/options/sms_api_type',
265 'type' => CRM_Utils_Type
::T_STRING
,
266 'title' => ts('SMS Provider API URL'),
268 'size' => CRM_Utils_Type
::HUGE
,
269 'where' => 'civicrm_sms_provider.api_url',
270 'table_name' => 'civicrm_sms_provider',
271 'entity' => 'Provider',
272 'bao' => 'CRM_SMS_BAO_Provider',
280 'name' => 'api_params',
281 'type' => CRM_Utils_Type
::T_TEXT
,
282 'title' => ts('SMS Provider API Params'),
283 'description' => ts('the api params in xml, http or smtp format'),
284 'where' => 'civicrm_sms_provider.api_params',
285 'table_name' => 'civicrm_sms_provider',
286 'entity' => 'Provider',
287 'bao' => 'CRM_SMS_BAO_Provider',
295 'name' => 'is_default',
296 'type' => CRM_Utils_Type
::T_BOOLEAN
,
297 'title' => ts('SMS Provider is Default?'),
298 'where' => 'civicrm_sms_provider.is_default',
300 'table_name' => 'civicrm_sms_provider',
301 'entity' => 'Provider',
302 'bao' => 'CRM_SMS_BAO_Provider',
305 'type' => 'CheckBox',
310 'name' => 'is_active',
311 'type' => CRM_Utils_Type
::T_BOOLEAN
,
312 'title' => ts('SMS Provider is Active?'),
313 'where' => 'civicrm_sms_provider.is_active',
315 'table_name' => 'civicrm_sms_provider',
316 'entity' => 'Provider',
317 'bao' => 'CRM_SMS_BAO_Provider',
320 'type' => 'CheckBox',
325 'name' => 'domain_id',
326 'type' => CRM_Utils_Type
::T_INT
,
327 'title' => ts('Domain ID'),
328 'description' => ts('Which Domain is this sms provider for'),
329 'where' => 'civicrm_sms_provider.domain_id',
330 'table_name' => 'civicrm_sms_provider',
331 'entity' => 'Provider',
332 'bao' => 'CRM_SMS_BAO_Provider',
334 'FKClassName' => 'CRM_Core_DAO_Domain',
336 'label' => ts("Domain"),
338 'pseudoconstant' => [
339 'table' => 'civicrm_domain',
341 'labelColumn' => 'name',
346 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
348 return Civi
::$statics[__CLASS__
]['fields'];
352 * Return a mapping from field-name to the corresponding key (as used in fields()).
355 * Array(string $name => string $uniqueName).
357 public static function &fieldKeys() {
358 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
359 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
361 return Civi
::$statics[__CLASS__
]['fieldKeys'];
365 * Returns the names of this table
369 public static function getTableName() {
370 return self
::$_tableName;
374 * Returns if this table needs to be logged
378 public function getLog() {
383 * Returns the list of fields that can be imported
385 * @param bool $prefix
389 public static function &import($prefix = FALSE) {
390 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
395 * Returns the list of fields that can be exported
397 * @param bool $prefix
401 public static function &export($prefix = FALSE) {
402 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
407 * Returns the list of indices
409 * @param bool $localize
413 public static function indices($localize = TRUE) {
415 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;