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:8f832b1b8dbd4cbee327a0900c128cc4)
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 foreign keys and entity references.
110 * [CRM_Core_Reference_Interface]
112 public static function getReferenceColumns() {
113 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
114 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
115 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
116 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
118 return Civi
::$statics[__CLASS__
]['links'];
122 * Returns all the column names of this table
126 public static function &fields() {
127 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
128 Civi
::$statics[__CLASS__
]['fields'] = [
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('SMS Provider ID'),
133 'description' => ts('SMS Provider ID'),
135 'where' => 'civicrm_sms_provider.id',
136 'table_name' => 'civicrm_sms_provider',
137 'entity' => 'Provider',
138 'bao' => 'CRM_SMS_BAO_Provider',
143 'type' => CRM_Utils_Type
::T_STRING
,
144 'title' => ts('SMS Provider Name'),
145 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
147 'size' => CRM_Utils_Type
::BIG
,
148 'where' => 'civicrm_sms_provider.name',
149 'table_name' => 'civicrm_sms_provider',
150 'entity' => 'Provider',
151 'bao' => 'CRM_SMS_BAO_Provider',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('SMS Provider Title'),
158 'description' => ts('Provider name visible to user'),
160 'size' => CRM_Utils_Type
::BIG
,
161 'where' => 'civicrm_sms_provider.title',
162 'table_name' => 'civicrm_sms_provider',
163 'entity' => 'Provider',
164 'bao' => 'CRM_SMS_BAO_Provider',
171 'name' => 'username',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('SMS Provider Username'),
175 'size' => CRM_Utils_Type
::HUGE
,
176 'where' => 'civicrm_sms_provider.username',
177 'table_name' => 'civicrm_sms_provider',
178 'entity' => 'Provider',
179 'bao' => 'CRM_SMS_BAO_Provider',
186 'name' => 'password',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('SMS Provider Password'),
190 'size' => CRM_Utils_Type
::HUGE
,
191 'where' => 'civicrm_sms_provider.password',
192 'table_name' => 'civicrm_sms_provider',
193 'entity' => 'Provider',
194 'bao' => 'CRM_SMS_BAO_Provider',
201 'name' => 'api_type',
202 'type' => CRM_Utils_Type
::T_INT
,
203 'title' => ts('SMS Provider API'),
204 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
206 'where' => 'civicrm_sms_provider.api_type',
207 'table_name' => 'civicrm_sms_provider',
208 'entity' => 'Provider',
209 'bao' => 'CRM_SMS_BAO_Provider',
214 'pseudoconstant' => [
215 'optionGroupName' => 'sms_api_type',
216 'optionEditPath' => 'civicrm/admin/options/sms_api_type',
221 'type' => CRM_Utils_Type
::T_STRING
,
222 'title' => ts('SMS Provider API URL'),
224 'size' => CRM_Utils_Type
::HUGE
,
225 'where' => 'civicrm_sms_provider.api_url',
226 'table_name' => 'civicrm_sms_provider',
227 'entity' => 'Provider',
228 'bao' => 'CRM_SMS_BAO_Provider',
235 'name' => 'api_params',
236 'type' => CRM_Utils_Type
::T_TEXT
,
237 'title' => ts('SMS Provider API Params'),
238 'description' => ts('the api params in xml, http or smtp format'),
239 'where' => 'civicrm_sms_provider.api_params',
240 'table_name' => 'civicrm_sms_provider',
241 'entity' => 'Provider',
242 'bao' => 'CRM_SMS_BAO_Provider',
249 'name' => 'is_default',
250 'type' => CRM_Utils_Type
::T_BOOLEAN
,
251 'title' => ts('SMS Provider is Default?'),
252 'where' => 'civicrm_sms_provider.is_default',
254 'table_name' => 'civicrm_sms_provider',
255 'entity' => 'Provider',
256 'bao' => 'CRM_SMS_BAO_Provider',
259 'type' => 'CheckBox',
263 'name' => 'is_active',
264 'type' => CRM_Utils_Type
::T_BOOLEAN
,
265 'title' => ts('SMS Provider is Active?'),
266 'where' => 'civicrm_sms_provider.is_active',
268 'table_name' => 'civicrm_sms_provider',
269 'entity' => 'Provider',
270 'bao' => 'CRM_SMS_BAO_Provider',
273 'type' => 'CheckBox',
277 'name' => 'domain_id',
278 'type' => CRM_Utils_Type
::T_INT
,
279 'title' => ts('SMS Domain'),
280 'description' => ts('Which Domain is this sms provider for'),
281 'where' => 'civicrm_sms_provider.domain_id',
282 'table_name' => 'civicrm_sms_provider',
283 'entity' => 'Provider',
284 'bao' => 'CRM_SMS_BAO_Provider',
286 'FKClassName' => 'CRM_Core_DAO_Domain',
287 'pseudoconstant' => [
288 'table' => 'civicrm_domain',
290 'labelColumn' => 'name',
294 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
296 return Civi
::$statics[__CLASS__
]['fields'];
300 * Return a mapping from field-name to the corresponding key (as used in fields()).
303 * Array(string $name => string $uniqueName).
305 public static function &fieldKeys() {
306 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
307 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
309 return Civi
::$statics[__CLASS__
]['fieldKeys'];
313 * Returns the names of this table
317 public static function getTableName() {
318 return self
::$_tableName;
322 * Returns if this table needs to be logged
326 public function getLog() {
331 * Returns the list of fields that can be imported
333 * @param bool $prefix
337 public static function &import($prefix = FALSE) {
338 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
343 * Returns the list of fields that can be exported
345 * @param bool $prefix
349 public static function &export($prefix = FALSE) {
350 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
355 * Returns the list of indices
357 * @param bool $localize
361 public static function indices($localize = TRUE) {
363 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;