5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/SMS/Provider.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:cae173c565ecbc84ccb905d80f1de8c1)
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 static $_tableName = 'civicrm_sms_provider';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'SMS Provider ID',
135 'table_name' => 'civicrm_sms_provider',
136 'entity' => 'Provider',
137 'bao' => 'CRM_SMS_BAO_Provider',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('SMS Provider Name'),
144 'description' => 'Provider internal name points to option_value of option_group sms_provider_name',
146 'size' => CRM_Utils_Type
::BIG
,
147 'table_name' => 'civicrm_sms_provider',
148 'entity' => 'Provider',
149 'bao' => 'CRM_SMS_BAO_Provider',
154 'type' => CRM_Utils_Type
::T_STRING
,
155 'title' => ts('SMS Provider Title'),
156 'description' => 'Provider name visible to user',
158 'size' => CRM_Utils_Type
::BIG
,
159 'table_name' => 'civicrm_sms_provider',
160 'entity' => 'Provider',
161 'bao' => 'CRM_SMS_BAO_Provider',
168 'name' => 'username',
169 'type' => CRM_Utils_Type
::T_STRING
,
170 'title' => ts('SMS Provider Username'),
172 'size' => CRM_Utils_Type
::HUGE
,
173 'table_name' => 'civicrm_sms_provider',
174 'entity' => 'Provider',
175 'bao' => 'CRM_SMS_BAO_Provider',
182 'name' => 'password',
183 'type' => CRM_Utils_Type
::T_STRING
,
184 'title' => ts('SMS Provider Password'),
186 'size' => CRM_Utils_Type
::HUGE
,
187 'table_name' => 'civicrm_sms_provider',
188 'entity' => 'Provider',
189 'bao' => 'CRM_SMS_BAO_Provider',
196 'name' => 'api_type',
197 'type' => CRM_Utils_Type
::T_INT
,
198 'title' => ts('SMS Provider API'),
199 'description' => 'points to value in civicrm_option_value for group sms_api_type',
201 'table_name' => 'civicrm_sms_provider',
202 'entity' => 'Provider',
203 'bao' => 'CRM_SMS_BAO_Provider',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('SMS Provider API URL'),
214 'size' => CRM_Utils_Type
::HUGE
,
215 'table_name' => 'civicrm_sms_provider',
216 'entity' => 'Provider',
217 'bao' => 'CRM_SMS_BAO_Provider',
224 'name' => 'api_params',
225 'type' => CRM_Utils_Type
::T_TEXT
,
226 'title' => ts('SMS Provider API Params'),
227 'description' => 'the api params in xml, http or smtp format',
228 'table_name' => 'civicrm_sms_provider',
229 'entity' => 'Provider',
230 'bao' => 'CRM_SMS_BAO_Provider',
237 'name' => 'is_default',
238 'type' => CRM_Utils_Type
::T_BOOLEAN
,
239 'title' => ts('SMS Provider is Default?'),
240 'table_name' => 'civicrm_sms_provider',
241 'entity' => 'Provider',
242 'bao' => 'CRM_SMS_BAO_Provider',
245 'type' => 'CheckBox',
249 'name' => 'is_active',
250 'type' => CRM_Utils_Type
::T_BOOLEAN
,
251 'title' => ts('SMS Provider is Active?'),
252 'table_name' => 'civicrm_sms_provider',
253 'entity' => 'Provider',
254 'bao' => 'CRM_SMS_BAO_Provider',
257 'type' => 'CheckBox',
261 'name' => 'domain_id',
262 'type' => CRM_Utils_Type
::T_INT
,
263 'title' => ts('SMS Domain'),
264 'description' => 'Which Domain is this sms provider for',
265 'table_name' => 'civicrm_sms_provider',
266 'entity' => 'Provider',
267 'bao' => 'CRM_SMS_BAO_Provider',
269 'FKClassName' => 'CRM_Core_DAO_Domain',
270 'pseudoconstant' => [
271 'table' => 'civicrm_domain',
273 'labelColumn' => 'name',
277 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
279 return Civi
::$statics[__CLASS__
]['fields'];
283 * Return a mapping from field-name to the corresponding key (as used in fields()).
286 * Array(string $name => string $uniqueName).
288 public static function &fieldKeys() {
289 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
290 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
292 return Civi
::$statics[__CLASS__
]['fieldKeys'];
296 * Returns the names of this table
300 public static function getTableName() {
301 return self
::$_tableName;
305 * Returns if this table needs to be logged
309 public function getLog() {
314 * Returns the list of fields that can be imported
316 * @param bool $prefix
320 public static function &import($prefix = FALSE) {
321 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, []);
326 * Returns the list of fields that can be exported
328 * @param bool $prefix
332 public static function &export($prefix = FALSE) {
333 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, []);
338 * Returns the list of indices
340 * @param bool $localize
344 public static function indices($localize = TRUE) {
346 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;