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:478e0d0caeb2d2a81068db6ad2db67aa)
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',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('SMS Provider Name'),
158 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
160 'size' => CRM_Utils_Type
::BIG
,
161 'where' => 'civicrm_sms_provider.name',
162 'table_name' => 'civicrm_sms_provider',
163 'entity' => 'Provider',
164 'bao' => 'CRM_SMS_BAO_Provider',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('SMS Provider Title'),
172 'description' => ts('Provider name visible to user'),
174 'size' => CRM_Utils_Type
::BIG
,
175 'where' => 'civicrm_sms_provider.title',
176 'table_name' => 'civicrm_sms_provider',
177 'entity' => 'Provider',
178 'bao' => 'CRM_SMS_BAO_Provider',
186 'name' => 'username',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('SMS Provider Username'),
190 'size' => CRM_Utils_Type
::HUGE
,
191 'where' => 'civicrm_sms_provider.username',
192 'table_name' => 'civicrm_sms_provider',
193 'entity' => 'Provider',
194 'bao' => 'CRM_SMS_BAO_Provider',
202 'name' => 'password',
203 'type' => CRM_Utils_Type
::T_STRING
,
204 'title' => ts('SMS Provider Password'),
206 'size' => CRM_Utils_Type
::HUGE
,
207 'where' => 'civicrm_sms_provider.password',
208 'table_name' => 'civicrm_sms_provider',
209 'entity' => 'Provider',
210 'bao' => 'CRM_SMS_BAO_Provider',
218 'name' => 'api_type',
219 'type' => CRM_Utils_Type
::T_INT
,
220 'title' => ts('SMS Provider API'),
221 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
223 'where' => 'civicrm_sms_provider.api_type',
224 'table_name' => 'civicrm_sms_provider',
225 'entity' => 'Provider',
226 'bao' => 'CRM_SMS_BAO_Provider',
231 'pseudoconstant' => [
232 'optionGroupName' => 'sms_api_type',
233 'optionEditPath' => 'civicrm/admin/options/sms_api_type',
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('SMS Provider API URL'),
242 'size' => CRM_Utils_Type
::HUGE
,
243 'where' => 'civicrm_sms_provider.api_url',
244 'table_name' => 'civicrm_sms_provider',
245 'entity' => 'Provider',
246 'bao' => 'CRM_SMS_BAO_Provider',
254 'name' => 'api_params',
255 'type' => CRM_Utils_Type
::T_TEXT
,
256 'title' => ts('SMS Provider API Params'),
257 'description' => ts('the api params in xml, http or smtp format'),
258 'where' => 'civicrm_sms_provider.api_params',
259 'table_name' => 'civicrm_sms_provider',
260 'entity' => 'Provider',
261 'bao' => 'CRM_SMS_BAO_Provider',
269 'name' => 'is_default',
270 'type' => CRM_Utils_Type
::T_BOOLEAN
,
271 'title' => ts('SMS Provider is Default?'),
272 'where' => 'civicrm_sms_provider.is_default',
274 'table_name' => 'civicrm_sms_provider',
275 'entity' => 'Provider',
276 'bao' => 'CRM_SMS_BAO_Provider',
279 'type' => 'CheckBox',
284 'name' => 'is_active',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('SMS Provider is Active?'),
287 'where' => 'civicrm_sms_provider.is_active',
289 'table_name' => 'civicrm_sms_provider',
290 'entity' => 'Provider',
291 'bao' => 'CRM_SMS_BAO_Provider',
294 'type' => 'CheckBox',
299 'name' => 'domain_id',
300 'type' => CRM_Utils_Type
::T_INT
,
301 'title' => ts('SMS Domain'),
302 'description' => ts('Which Domain is this sms provider for'),
303 'where' => 'civicrm_sms_provider.domain_id',
304 'table_name' => 'civicrm_sms_provider',
305 'entity' => 'Provider',
306 'bao' => 'CRM_SMS_BAO_Provider',
308 'FKClassName' => 'CRM_Core_DAO_Domain',
309 'pseudoconstant' => [
310 'table' => 'civicrm_domain',
312 'labelColumn' => 'name',
317 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
319 return Civi
::$statics[__CLASS__
]['fields'];
323 * Return a mapping from field-name to the corresponding key (as used in fields()).
326 * Array(string $name => string $uniqueName).
328 public static function &fieldKeys() {
329 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
330 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
332 return Civi
::$statics[__CLASS__
]['fieldKeys'];
336 * Returns the names of this table
340 public static function getTableName() {
341 return self
::$_tableName;
345 * Returns if this table needs to be logged
349 public function getLog() {
354 * Returns the list of fields that can be imported
356 * @param bool $prefix
360 public static function &import($prefix = FALSE) {
361 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
366 * Returns the list of fields that can be exported
368 * @param bool $prefix
372 public static function &export($prefix = FALSE) {
373 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
378 * Returns the list of indices
380 * @param bool $localize
384 public static function indices($localize = TRUE) {
386 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;