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:0411ce23fd693f810e4b17271b84e567)
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 * @param bool $plural
112 * Whether to return the plural version of the title.
114 public static function getEntityTitle($plural = FALSE) {
115 return $plural ?
ts('Providers') : ts('Provider');
119 * Returns foreign keys and entity references.
122 * [CRM_Core_Reference_Interface]
124 public static function getReferenceColumns() {
125 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
126 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
127 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
128 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
130 return Civi
::$statics[__CLASS__
]['links'];
134 * Returns all the column names of this table
138 public static function &fields() {
139 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
140 Civi
::$statics[__CLASS__
]['fields'] = [
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('SMS Provider ID'),
145 'description' => ts('SMS Provider ID'),
147 'where' => 'civicrm_sms_provider.id',
148 'table_name' => 'civicrm_sms_provider',
149 'entity' => 'Provider',
150 'bao' => 'CRM_SMS_BAO_Provider',
160 'type' => CRM_Utils_Type
::T_STRING
,
161 'title' => ts('SMS Provider Name'),
162 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
164 'size' => CRM_Utils_Type
::BIG
,
165 'where' => 'civicrm_sms_provider.name',
166 'table_name' => 'civicrm_sms_provider',
167 'entity' => 'Provider',
168 'bao' => 'CRM_SMS_BAO_Provider',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('SMS Provider Title'),
176 'description' => ts('Provider name visible to user'),
178 'size' => CRM_Utils_Type
::BIG
,
179 'where' => 'civicrm_sms_provider.title',
180 'table_name' => 'civicrm_sms_provider',
181 'entity' => 'Provider',
182 'bao' => 'CRM_SMS_BAO_Provider',
190 'name' => 'username',
191 'type' => CRM_Utils_Type
::T_STRING
,
192 'title' => ts('SMS Provider Username'),
194 'size' => CRM_Utils_Type
::HUGE
,
195 'where' => 'civicrm_sms_provider.username',
196 'table_name' => 'civicrm_sms_provider',
197 'entity' => 'Provider',
198 'bao' => 'CRM_SMS_BAO_Provider',
206 'name' => 'password',
207 'type' => CRM_Utils_Type
::T_STRING
,
208 'title' => ts('SMS Provider Password'),
210 'size' => CRM_Utils_Type
::HUGE
,
211 'where' => 'civicrm_sms_provider.password',
212 'table_name' => 'civicrm_sms_provider',
213 'entity' => 'Provider',
214 'bao' => 'CRM_SMS_BAO_Provider',
222 'name' => 'api_type',
223 'type' => CRM_Utils_Type
::T_INT
,
224 'title' => ts('SMS Provider API'),
225 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
227 'where' => 'civicrm_sms_provider.api_type',
228 'table_name' => 'civicrm_sms_provider',
229 'entity' => 'Provider',
230 'bao' => 'CRM_SMS_BAO_Provider',
235 'pseudoconstant' => [
236 'optionGroupName' => 'sms_api_type',
237 'optionEditPath' => 'civicrm/admin/options/sms_api_type',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('SMS Provider API URL'),
246 'size' => CRM_Utils_Type
::HUGE
,
247 'where' => 'civicrm_sms_provider.api_url',
248 'table_name' => 'civicrm_sms_provider',
249 'entity' => 'Provider',
250 'bao' => 'CRM_SMS_BAO_Provider',
258 'name' => 'api_params',
259 'type' => CRM_Utils_Type
::T_TEXT
,
260 'title' => ts('SMS Provider API Params'),
261 'description' => ts('the api params in xml, http or smtp format'),
262 'where' => 'civicrm_sms_provider.api_params',
263 'table_name' => 'civicrm_sms_provider',
264 'entity' => 'Provider',
265 'bao' => 'CRM_SMS_BAO_Provider',
273 'name' => 'is_default',
274 'type' => CRM_Utils_Type
::T_BOOLEAN
,
275 'title' => ts('SMS Provider is Default?'),
276 'where' => 'civicrm_sms_provider.is_default',
278 'table_name' => 'civicrm_sms_provider',
279 'entity' => 'Provider',
280 'bao' => 'CRM_SMS_BAO_Provider',
283 'type' => 'CheckBox',
288 'name' => 'is_active',
289 'type' => CRM_Utils_Type
::T_BOOLEAN
,
290 'title' => ts('SMS Provider is Active?'),
291 'where' => 'civicrm_sms_provider.is_active',
293 'table_name' => 'civicrm_sms_provider',
294 'entity' => 'Provider',
295 'bao' => 'CRM_SMS_BAO_Provider',
298 'type' => 'CheckBox',
303 'name' => 'domain_id',
304 'type' => CRM_Utils_Type
::T_INT
,
305 'title' => ts('Domain ID'),
306 'description' => ts('Which Domain is this sms provider for'),
307 'where' => 'civicrm_sms_provider.domain_id',
308 'table_name' => 'civicrm_sms_provider',
309 'entity' => 'Provider',
310 'bao' => 'CRM_SMS_BAO_Provider',
312 'FKClassName' => 'CRM_Core_DAO_Domain',
314 'label' => ts("Domain"),
316 'pseudoconstant' => [
317 'table' => 'civicrm_domain',
319 'labelColumn' => 'name',
324 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
326 return Civi
::$statics[__CLASS__
]['fields'];
330 * Return a mapping from field-name to the corresponding key (as used in fields()).
333 * Array(string $name => string $uniqueName).
335 public static function &fieldKeys() {
336 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
337 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
339 return Civi
::$statics[__CLASS__
]['fieldKeys'];
343 * Returns the names of this table
347 public static function getTableName() {
348 return self
::$_tableName;
352 * Returns if this table needs to be logged
356 public function getLog() {
361 * Returns the list of fields that can be imported
363 * @param bool $prefix
367 public static function &import($prefix = FALSE) {
368 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
373 * Returns the list of fields that can be exported
375 * @param bool $prefix
379 public static function &export($prefix = FALSE) {
380 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
385 * Returns the list of indices
387 * @param bool $localize
391 public static function indices($localize = TRUE) {
393 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;