5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/SMS/Provider.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a24ea48b652eba8827a5275a127df61e)
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',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('SMS Provider API URL'),
220 'size' => CRM_Utils_Type
::HUGE
,
221 'where' => 'civicrm_sms_provider.api_url',
222 'table_name' => 'civicrm_sms_provider',
223 'entity' => 'Provider',
224 'bao' => 'CRM_SMS_BAO_Provider',
231 'name' => 'api_params',
232 'type' => CRM_Utils_Type
::T_TEXT
,
233 'title' => ts('SMS Provider API Params'),
234 'description' => ts('the api params in xml, http or smtp format'),
235 'where' => 'civicrm_sms_provider.api_params',
236 'table_name' => 'civicrm_sms_provider',
237 'entity' => 'Provider',
238 'bao' => 'CRM_SMS_BAO_Provider',
245 'name' => 'is_default',
246 'type' => CRM_Utils_Type
::T_BOOLEAN
,
247 'title' => ts('SMS Provider is Default?'),
248 'where' => 'civicrm_sms_provider.is_default',
250 'table_name' => 'civicrm_sms_provider',
251 'entity' => 'Provider',
252 'bao' => 'CRM_SMS_BAO_Provider',
255 'type' => 'CheckBox',
259 'name' => 'is_active',
260 'type' => CRM_Utils_Type
::T_BOOLEAN
,
261 'title' => ts('SMS Provider is Active?'),
262 'where' => 'civicrm_sms_provider.is_active',
264 'table_name' => 'civicrm_sms_provider',
265 'entity' => 'Provider',
266 'bao' => 'CRM_SMS_BAO_Provider',
269 'type' => 'CheckBox',
273 'name' => 'domain_id',
274 'type' => CRM_Utils_Type
::T_INT
,
275 'title' => ts('SMS Domain'),
276 'description' => ts('Which Domain is this sms provider for'),
277 'where' => 'civicrm_sms_provider.domain_id',
278 'table_name' => 'civicrm_sms_provider',
279 'entity' => 'Provider',
280 'bao' => 'CRM_SMS_BAO_Provider',
282 'FKClassName' => 'CRM_Core_DAO_Domain',
283 'pseudoconstant' => [
284 'table' => 'civicrm_domain',
286 'labelColumn' => 'name',
290 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
292 return Civi
::$statics[__CLASS__
]['fields'];
296 * Return a mapping from field-name to the corresponding key (as used in fields()).
299 * Array(string $name => string $uniqueName).
301 public static function &fieldKeys() {
302 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
303 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
305 return Civi
::$statics[__CLASS__
]['fieldKeys'];
309 * Returns the names of this table
313 public static function getTableName() {
314 return self
::$_tableName;
318 * Returns if this table needs to be logged
322 public function getLog() {
327 * Returns the list of fields that can be imported
329 * @param bool $prefix
333 public static function &import($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
339 * Returns the list of fields that can be exported
341 * @param bool $prefix
345 public static function &export($prefix = FALSE) {
346 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
351 * Returns the list of indices
353 * @param bool $localize
357 public static function indices($localize = TRUE) {
359 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;