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:096f39952e1259e5982166966f04ac02)
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',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('SMS Provider Name'),
161 'description' => ts('Provider internal name points to option_value of option_group sms_provider_name'),
163 'size' => CRM_Utils_Type
::BIG
,
164 'where' => 'civicrm_sms_provider.name',
165 'table_name' => 'civicrm_sms_provider',
166 'entity' => 'Provider',
167 'bao' => 'CRM_SMS_BAO_Provider',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('SMS Provider Title'),
175 'description' => ts('Provider name visible to user'),
177 'size' => CRM_Utils_Type
::BIG
,
178 'where' => 'civicrm_sms_provider.title',
179 'table_name' => 'civicrm_sms_provider',
180 'entity' => 'Provider',
181 'bao' => 'CRM_SMS_BAO_Provider',
189 'name' => 'username',
190 'type' => CRM_Utils_Type
::T_STRING
,
191 'title' => ts('SMS Provider Username'),
193 'size' => CRM_Utils_Type
::HUGE
,
194 'where' => 'civicrm_sms_provider.username',
195 'table_name' => 'civicrm_sms_provider',
196 'entity' => 'Provider',
197 'bao' => 'CRM_SMS_BAO_Provider',
205 'name' => 'password',
206 'type' => CRM_Utils_Type
::T_STRING
,
207 'title' => ts('SMS Provider Password'),
209 'size' => CRM_Utils_Type
::HUGE
,
210 'where' => 'civicrm_sms_provider.password',
211 'table_name' => 'civicrm_sms_provider',
212 'entity' => 'Provider',
213 'bao' => 'CRM_SMS_BAO_Provider',
221 'name' => 'api_type',
222 'type' => CRM_Utils_Type
::T_INT
,
223 'title' => ts('SMS Provider API'),
224 'description' => ts('points to value in civicrm_option_value for group sms_api_type'),
226 'where' => 'civicrm_sms_provider.api_type',
227 'table_name' => 'civicrm_sms_provider',
228 'entity' => 'Provider',
229 'bao' => 'CRM_SMS_BAO_Provider',
234 'pseudoconstant' => [
235 'optionGroupName' => 'sms_api_type',
236 'optionEditPath' => 'civicrm/admin/options/sms_api_type',
242 'type' => CRM_Utils_Type
::T_STRING
,
243 'title' => ts('SMS Provider API URL'),
245 'size' => CRM_Utils_Type
::HUGE
,
246 'where' => 'civicrm_sms_provider.api_url',
247 'table_name' => 'civicrm_sms_provider',
248 'entity' => 'Provider',
249 'bao' => 'CRM_SMS_BAO_Provider',
257 'name' => 'api_params',
258 'type' => CRM_Utils_Type
::T_TEXT
,
259 'title' => ts('SMS Provider API Params'),
260 'description' => ts('the api params in xml, http or smtp format'),
261 'where' => 'civicrm_sms_provider.api_params',
262 'table_name' => 'civicrm_sms_provider',
263 'entity' => 'Provider',
264 'bao' => 'CRM_SMS_BAO_Provider',
272 'name' => 'is_default',
273 'type' => CRM_Utils_Type
::T_BOOLEAN
,
274 'title' => ts('SMS Provider is Default?'),
275 'where' => 'civicrm_sms_provider.is_default',
277 'table_name' => 'civicrm_sms_provider',
278 'entity' => 'Provider',
279 'bao' => 'CRM_SMS_BAO_Provider',
282 'type' => 'CheckBox',
287 'name' => 'is_active',
288 'type' => CRM_Utils_Type
::T_BOOLEAN
,
289 'title' => ts('SMS Provider is Active?'),
290 'where' => 'civicrm_sms_provider.is_active',
292 'table_name' => 'civicrm_sms_provider',
293 'entity' => 'Provider',
294 'bao' => 'CRM_SMS_BAO_Provider',
297 'type' => 'CheckBox',
302 'name' => 'domain_id',
303 'type' => CRM_Utils_Type
::T_INT
,
304 'title' => ts('Domain ID'),
305 'description' => ts('Which Domain is this sms provider for'),
306 'where' => 'civicrm_sms_provider.domain_id',
307 'table_name' => 'civicrm_sms_provider',
308 'entity' => 'Provider',
309 'bao' => 'CRM_SMS_BAO_Provider',
311 'FKClassName' => 'CRM_Core_DAO_Domain',
313 'label' => ts("Domain"),
315 'pseudoconstant' => [
316 'table' => 'civicrm_domain',
318 'labelColumn' => 'name',
323 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
325 return Civi
::$statics[__CLASS__
]['fields'];
329 * Return a mapping from field-name to the corresponding key (as used in fields()).
332 * Array(string $name => string $uniqueName).
334 public static function &fieldKeys() {
335 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
336 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
338 return Civi
::$statics[__CLASS__
]['fieldKeys'];
342 * Returns the names of this table
346 public static function getTableName() {
347 return self
::$_tableName;
351 * Returns if this table needs to be logged
355 public function getLog() {
360 * Returns the list of fields that can be imported
362 * @param bool $prefix
366 public static function &import($prefix = FALSE) {
367 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
372 * Returns the list of fields that can be exported
374 * @param bool $prefix
378 public static function &export($prefix = FALSE) {
379 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
384 * Returns the list of indices
386 * @param bool $localize
390 public static function indices($localize = TRUE) {
392 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;