3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/SMS/Provider.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:cae173c565ecbc84ccb905d80f1de8c1)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_SMS_DAO_Provider constructor.
40 class CRM_SMS_DAO_Provider
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_sms_provider';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Provider internal name points to option_value of option_group sms_provider_name
66 * Provider name visible to user
82 * points to value in civicrm_option_value for group sms_api_type
93 * the api params in xml, http or smtp format
109 * Which Domain is this sms provider for
117 function __construct() {
118 $this->__table
= 'civicrm_sms_provider';
119 parent
::__construct();
122 * Returns foreign keys and entity references.
125 * [CRM_Core_Reference_Interface]
127 static function getReferenceColumns() {
128 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
129 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
130 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
133 return Civi
::$statics[__CLASS__
]['links'];
136 * Returns all the column names of this table
140 static function &fields() {
141 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
142 Civi
::$statics[__CLASS__
]['fields'] = array(
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('SMS Provider ID') ,
147 'description' => 'SMS Provider ID',
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 Name') ,
158 'description' => 'Provider internal name points to option_value of option_group sms_provider_name',
160 'size' => CRM_Utils_Type
::BIG
,
161 'table_name' => 'civicrm_sms_provider',
162 'entity' => 'Provider',
163 'bao' => 'CRM_SMS_BAO_Provider',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('SMS Provider Title') ,
170 'description' => 'Provider name visible to user',
172 'size' => CRM_Utils_Type
::BIG
,
173 'table_name' => 'civicrm_sms_provider',
174 'entity' => 'Provider',
175 'bao' => 'CRM_SMS_BAO_Provider',
182 'name' => 'username',
183 'type' => CRM_Utils_Type
::T_STRING
,
184 'title' => ts('SMS Provider Username') ,
186 'size' => CRM_Utils_Type
::HUGE
,
187 'table_name' => 'civicrm_sms_provider',
188 'entity' => 'Provider',
189 'bao' => 'CRM_SMS_BAO_Provider',
196 'name' => 'password',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('SMS Provider Password') ,
200 'size' => CRM_Utils_Type
::HUGE
,
201 'table_name' => 'civicrm_sms_provider',
202 'entity' => 'Provider',
203 'bao' => 'CRM_SMS_BAO_Provider',
210 'name' => 'api_type',
211 'type' => CRM_Utils_Type
::T_INT
,
212 'title' => ts('SMS Provider API') ,
213 'description' => 'points to value in civicrm_option_value for group sms_api_type',
215 'table_name' => 'civicrm_sms_provider',
216 'entity' => 'Provider',
217 'bao' => 'CRM_SMS_BAO_Provider',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('SMS Provider API URL') ,
228 'size' => CRM_Utils_Type
::HUGE
,
229 'table_name' => 'civicrm_sms_provider',
230 'entity' => 'Provider',
231 'bao' => 'CRM_SMS_BAO_Provider',
237 'api_params' => array(
238 'name' => 'api_params',
239 'type' => CRM_Utils_Type
::T_TEXT
,
240 'title' => ts('SMS Provider API Params') ,
241 'description' => 'the api params in xml, http or smtp format',
242 'table_name' => 'civicrm_sms_provider',
243 'entity' => 'Provider',
244 'bao' => 'CRM_SMS_BAO_Provider',
250 'is_default' => array(
251 'name' => 'is_default',
252 'type' => CRM_Utils_Type
::T_BOOLEAN
,
253 'title' => ts('SMS Provider is Default?') ,
254 'table_name' => 'civicrm_sms_provider',
255 'entity' => 'Provider',
256 'bao' => 'CRM_SMS_BAO_Provider',
259 'type' => 'CheckBox',
262 'is_active' => array(
263 'name' => 'is_active',
264 'type' => CRM_Utils_Type
::T_BOOLEAN
,
265 'title' => ts('SMS Provider is Active?') ,
266 'table_name' => 'civicrm_sms_provider',
267 'entity' => 'Provider',
268 'bao' => 'CRM_SMS_BAO_Provider',
271 'type' => 'CheckBox',
274 'domain_id' => array(
275 'name' => 'domain_id',
276 'type' => CRM_Utils_Type
::T_INT
,
277 'title' => ts('SMS Domain') ,
278 'description' => 'Which Domain is this sms provider for',
279 'table_name' => 'civicrm_sms_provider',
280 'entity' => 'Provider',
281 'bao' => 'CRM_SMS_BAO_Provider',
283 'FKClassName' => 'CRM_Core_DAO_Domain',
284 'pseudoconstant' => array(
285 'table' => 'civicrm_domain',
287 'labelColumn' => 'name',
291 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
293 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 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'];
308 * Returns the names of this table
312 static function getTableName() {
313 return self
::$_tableName;
316 * Returns if this table needs to be logged
324 * Returns the list of fields that can be imported
326 * @param bool $prefix
330 static function &import($prefix = false) {
331 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'sms_provider', $prefix, array());
335 * Returns the list of fields that can be exported
337 * @param bool $prefix
341 static function &export($prefix = false) {
342 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'sms_provider', $prefix, array());
346 * Returns the list of indices
348 public static function indices($localize = TRUE) {
350 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;