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:6ecda65bd52b36e04764cec8ee81e1b8)
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;
41 * Provider internal name points to option_value of option_group sms_provider_name
48 * Provider name visible to user
65 * points to value in civicrm_option_value for group sms_api_type
77 * the api params in xml, http or smtp format
94 * Which Domain is this sms provider for
103 public function __construct() {
104 $this->__table
= 'civicrm_sms_provider';
105 parent
::__construct();
109 * Returns localized title of this entity.
111 public static function getEntityTitle() {
112 return ts('Providers');
116 * Returns foreign keys and entity references.
119 * [CRM_Core_Reference_Interface]
121 public static function getReferenceColumns() {
122 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
123 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
124 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
125 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
127 return Civi
::$statics[__CLASS__
]['links'];
131 * Returns all the column names of this table
135 public static function &fields() {
136 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
137 Civi
::$statics[__CLASS__
]['fields'] = [
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('SMS Provider ID'),
142 'description' => ts('SMS Provider ID'),
144 'where' => 'civicrm_sms_provider.id',
145 'table_name' => 'civicrm_sms_provider',
146 'entity' => 'Provider',
147 'bao' => 'CRM_SMS_BAO_Provider',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('SMS Provider Name'),
155 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'where' => 'civicrm_sms_provider.name',
159 'table_name' => 'civicrm_sms_provider',
160 'entity' => 'Provider',
161 'bao' => 'CRM_SMS_BAO_Provider',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('SMS Provider Title'),
169 'description' => ts('Provider name visible to user'),
171 'size' => CRM_Utils_Type
::BIG
,
172 'where' => 'civicrm_sms_provider.title',
173 'table_name' => 'civicrm_sms_provider',
174 'entity' => 'Provider',
175 'bao' => 'CRM_SMS_BAO_Provider',
183 'name' => 'username',
184 'type' => CRM_Utils_Type
::T_STRING
,
185 'title' => ts('SMS Provider Username'),
187 'size' => CRM_Utils_Type
::HUGE
,
188 'where' => 'civicrm_sms_provider.username',
189 'table_name' => 'civicrm_sms_provider',
190 'entity' => 'Provider',
191 'bao' => 'CRM_SMS_BAO_Provider',
199 'name' => 'password',
200 'type' => CRM_Utils_Type
::T_STRING
,
201 'title' => ts('SMS Provider Password'),
203 'size' => CRM_Utils_Type
::HUGE
,
204 'where' => 'civicrm_sms_provider.password',
205 'table_name' => 'civicrm_sms_provider',
206 'entity' => 'Provider',
207 'bao' => 'CRM_SMS_BAO_Provider',
215 'name' => 'api_type',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('SMS Provider API'),
218 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
220 'where' => 'civicrm_sms_provider.api_type',
221 'table_name' => 'civicrm_sms_provider',
222 'entity' => 'Provider',
223 'bao' => 'CRM_SMS_BAO_Provider',
228 'pseudoconstant' => [
229 'optionGroupName' => 'sms_api_type',
230 'optionEditPath' => 'civicrm/admin/options/sms_api_type',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('SMS Provider API URL'),
239 'size' => CRM_Utils_Type
::HUGE
,
240 'where' => 'civicrm_sms_provider.api_url',
241 'table_name' => 'civicrm_sms_provider',
242 'entity' => 'Provider',
243 'bao' => 'CRM_SMS_BAO_Provider',
251 'name' => 'api_params',
252 'type' => CRM_Utils_Type
::T_TEXT
,
253 'title' => ts('SMS Provider API Params'),
254 'description' => ts('the api params in xml, http or smtp format'),
255 'where' => 'civicrm_sms_provider.api_params',
256 'table_name' => 'civicrm_sms_provider',
257 'entity' => 'Provider',
258 'bao' => 'CRM_SMS_BAO_Provider',
266 'name' => 'is_default',
267 'type' => CRM_Utils_Type
::T_BOOLEAN
,
268 'title' => ts('SMS Provider is Default?'),
269 'where' => 'civicrm_sms_provider.is_default',
271 'table_name' => 'civicrm_sms_provider',
272 'entity' => 'Provider',
273 'bao' => 'CRM_SMS_BAO_Provider',
276 'type' => 'CheckBox',
281 'name' => 'is_active',
282 'type' => CRM_Utils_Type
::T_BOOLEAN
,
283 'title' => ts('SMS Provider is Active?'),
284 'where' => 'civicrm_sms_provider.is_active',
286 'table_name' => 'civicrm_sms_provider',
287 'entity' => 'Provider',
288 'bao' => 'CRM_SMS_BAO_Provider',
291 'type' => 'CheckBox',
296 'name' => 'domain_id',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('SMS Domain'),
299 'description' => ts('Which Domain is this sms provider for'),
300 'where' => 'civicrm_sms_provider.domain_id',
301 'table_name' => 'civicrm_sms_provider',
302 'entity' => 'Provider',
303 'bao' => 'CRM_SMS_BAO_Provider',
305 'FKClassName' => 'CRM_Core_DAO_Domain',
306 'pseudoconstant' => [
307 'table' => 'civicrm_domain',
309 'labelColumn' => 'name',
314 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
316 return Civi
::$statics[__CLASS__
]['fields'];
320 * Return a mapping from field-name to the corresponding key (as used in fields()).
323 * Array(string $name => string $uniqueName).
325 public static function &fieldKeys() {
326 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
327 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
329 return Civi
::$statics[__CLASS__
]['fieldKeys'];
333 * Returns the names of this table
337 public static function getTableName() {
338 return self
::$_tableName;
342 * Returns if this table needs to be logged
346 public function getLog() {
351 * Returns the list of fields that can be imported
353 * @param bool $prefix
357 public static function &import($prefix = FALSE) {
358 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
363 * Returns the list of fields that can be exported
365 * @param bool $prefix
369 public static function &export($prefix = FALSE) {
370 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
375 * Returns the list of indices
377 * @param bool $localize
381 public static function indices($localize = TRUE) {
383 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;