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:964732a3dec2213ab9106ddd23e5391d)
13 * Database access object for the Provider entity.
15 class CRM_SMS_DAO_Provider
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_sms_provider';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Provider internal name points to option_value of option_group sms_provider_name
46 * Provider name visible to user
63 * points to value in civicrm_option_value for group sms_api_type
75 * the api params in xml, http or smtp format
92 * Which Domain is this sms provider for
101 public function __construct() {
102 $this->__table
= 'civicrm_sms_provider';
103 parent
::__construct();
107 * Returns localized title of this entity.
109 public static function getEntityTitle() {
110 return ts('Providers');
114 * Returns foreign keys and entity references.
117 * [CRM_Core_Reference_Interface]
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']);
125 return Civi
::$statics[__CLASS__
]['links'];
129 * Returns all the column names of this table
133 public static function &fields() {
134 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
135 Civi
::$statics[__CLASS__
]['fields'] = [
138 'type' => CRM_Utils_Type
::T_INT
,
139 'title' => ts('SMS Provider ID'),
140 'description' => ts('SMS Provider ID'),
142 'where' => 'civicrm_sms_provider.id',
143 'table_name' => 'civicrm_sms_provider',
144 'entity' => 'Provider',
145 'bao' => 'CRM_SMS_BAO_Provider',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('SMS Provider Name'),
152 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
154 'size' => CRM_Utils_Type
::BIG
,
155 'where' => 'civicrm_sms_provider.name',
156 'table_name' => 'civicrm_sms_provider',
157 'entity' => 'Provider',
158 'bao' => 'CRM_SMS_BAO_Provider',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('SMS Provider Title'),
165 'description' => ts('Provider name visible to user'),
167 'size' => CRM_Utils_Type
::BIG
,
168 'where' => 'civicrm_sms_provider.title',
169 'table_name' => 'civicrm_sms_provider',
170 'entity' => 'Provider',
171 'bao' => 'CRM_SMS_BAO_Provider',
178 'name' => 'username',
179 'type' => CRM_Utils_Type
::T_STRING
,
180 'title' => ts('SMS Provider Username'),
182 'size' => CRM_Utils_Type
::HUGE
,
183 'where' => 'civicrm_sms_provider.username',
184 'table_name' => 'civicrm_sms_provider',
185 'entity' => 'Provider',
186 'bao' => 'CRM_SMS_BAO_Provider',
193 'name' => 'password',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('SMS Provider Password'),
197 'size' => CRM_Utils_Type
::HUGE
,
198 'where' => 'civicrm_sms_provider.password',
199 'table_name' => 'civicrm_sms_provider',
200 'entity' => 'Provider',
201 'bao' => 'CRM_SMS_BAO_Provider',
208 'name' => 'api_type',
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('SMS Provider API'),
211 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
213 'where' => 'civicrm_sms_provider.api_type',
214 'table_name' => 'civicrm_sms_provider',
215 'entity' => 'Provider',
216 'bao' => 'CRM_SMS_BAO_Provider',
221 'pseudoconstant' => [
222 'optionGroupName' => 'sms_api_type',
223 'optionEditPath' => 'civicrm/admin/options/sms_api_type',
228 'type' => CRM_Utils_Type
::T_STRING
,
229 'title' => ts('SMS Provider API URL'),
231 'size' => CRM_Utils_Type
::HUGE
,
232 'where' => 'civicrm_sms_provider.api_url',
233 'table_name' => 'civicrm_sms_provider',
234 'entity' => 'Provider',
235 'bao' => 'CRM_SMS_BAO_Provider',
242 'name' => 'api_params',
243 'type' => CRM_Utils_Type
::T_TEXT
,
244 'title' => ts('SMS Provider API Params'),
245 'description' => ts('the api params in xml, http or smtp format'),
246 'where' => 'civicrm_sms_provider.api_params',
247 'table_name' => 'civicrm_sms_provider',
248 'entity' => 'Provider',
249 'bao' => 'CRM_SMS_BAO_Provider',
256 'name' => 'is_default',
257 'type' => CRM_Utils_Type
::T_BOOLEAN
,
258 'title' => ts('SMS Provider is Default?'),
259 'where' => 'civicrm_sms_provider.is_default',
261 'table_name' => 'civicrm_sms_provider',
262 'entity' => 'Provider',
263 'bao' => 'CRM_SMS_BAO_Provider',
266 'type' => 'CheckBox',
270 'name' => 'is_active',
271 'type' => CRM_Utils_Type
::T_BOOLEAN
,
272 'title' => ts('SMS Provider is Active?'),
273 'where' => 'civicrm_sms_provider.is_active',
275 'table_name' => 'civicrm_sms_provider',
276 'entity' => 'Provider',
277 'bao' => 'CRM_SMS_BAO_Provider',
280 'type' => 'CheckBox',
284 'name' => 'domain_id',
285 'type' => CRM_Utils_Type
::T_INT
,
286 'title' => ts('SMS Domain'),
287 'description' => ts('Which Domain is this sms provider for'),
288 'where' => 'civicrm_sms_provider.domain_id',
289 'table_name' => 'civicrm_sms_provider',
290 'entity' => 'Provider',
291 'bao' => 'CRM_SMS_BAO_Provider',
293 'FKClassName' => 'CRM_Core_DAO_Domain',
294 'pseudoconstant' => [
295 'table' => 'civicrm_domain',
297 'labelColumn' => 'name',
301 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
303 return Civi
::$statics[__CLASS__
]['fields'];
307 * Return a mapping from field-name to the corresponding key (as used in fields()).
310 * Array(string $name => string $uniqueName).
312 public static function &fieldKeys() {
313 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
314 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
316 return Civi
::$statics[__CLASS__
]['fieldKeys'];
320 * Returns the names of this table
324 public static function getTableName() {
325 return self
::$_tableName;
329 * Returns if this table needs to be logged
333 public function getLog() {
338 * Returns the list of fields that can be imported
340 * @param bool $prefix
344 public static function &import($prefix = FALSE) {
345 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
350 * Returns the list of fields that can be exported
352 * @param bool $prefix
356 public static function &export($prefix = FALSE) {
357 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
362 * Returns the list of indices
364 * @param bool $localize
368 public static function indices($localize = TRUE) {
370 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;