Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2016 | | |
7 | +--------------------------------------------------------------------+ | |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
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. | | |
13 | | | | |
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. | | |
18 | | | | |
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 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | /** | |
28 | * @package CRM | |
29 | * @copyright CiviCRM LLC (c) 2004-2016 | |
30 | * | |
31 | * Generated from xml/schema/CRM/SMS/Provider.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:31f5a6353dfc5b4630f3e0e9e82ce40e) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_SMS_DAO_Provider extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_sms_provider'; | |
44 | /** | |
45 | * static instance to hold the field values | |
46 | * | |
47 | * @var array | |
48 | */ | |
49 | static $_fields = null; | |
50 | /** | |
51 | * static instance to hold the keys used in $_fields for each field. | |
52 | * | |
53 | * @var array | |
54 | */ | |
55 | static $_fieldKeys = null; | |
56 | /** | |
57 | * static instance to hold the FK relationships | |
58 | * | |
59 | * @var string | |
60 | */ | |
61 | static $_links = null; | |
e501603b TO |
62 | /** |
63 | * static value to see if we should log any modifications to | |
64 | * this table in the civicrm_log table | |
65 | * | |
66 | * @var boolean | |
67 | */ | |
68 | static $_log = false; | |
69 | /** | |
70 | * SMS Provider ID | |
71 | * | |
72 | * @var int unsigned | |
73 | */ | |
74 | public $id; | |
75 | /** | |
76 | * Provider internal name points to option_value of option_group sms_provider_name | |
77 | * | |
78 | * @var string | |
79 | */ | |
80 | public $name; | |
81 | /** | |
82 | * Provider name visible to user | |
83 | * | |
84 | * @var string | |
85 | */ | |
86 | public $title; | |
87 | /** | |
88 | * | |
89 | * @var string | |
90 | */ | |
91 | public $username; | |
92 | /** | |
93 | * | |
94 | * @var string | |
95 | */ | |
96 | public $password; | |
97 | /** | |
98 | * points to value in civicrm_option_value for group sms_api_type | |
99 | * | |
100 | * @var int unsigned | |
101 | */ | |
102 | public $api_type; | |
103 | /** | |
104 | * | |
105 | * @var string | |
106 | */ | |
107 | public $api_url; | |
108 | /** | |
109 | * the api params in xml, http or smtp format | |
110 | * | |
111 | * @var text | |
112 | */ | |
113 | public $api_params; | |
114 | /** | |
115 | * | |
116 | * @var boolean | |
117 | */ | |
118 | public $is_default; | |
119 | /** | |
120 | * | |
121 | * @var boolean | |
122 | */ | |
123 | public $is_active; | |
124 | /** | |
125 | * class constructor | |
126 | * | |
127 | * @return civicrm_sms_provider | |
128 | */ | |
129 | function __construct() { | |
130 | $this->__table = 'civicrm_sms_provider'; | |
131 | parent::__construct(); | |
132 | } | |
133 | /** | |
134 | * Returns all the column names of this table | |
135 | * | |
136 | * @return array | |
137 | */ | |
138 | static function &fields() { | |
139 | if (!(self::$_fields)) { | |
140 | self::$_fields = array( | |
141 | 'id' => array( | |
142 | 'name' => 'id', | |
143 | 'type' => CRM_Utils_Type::T_INT, | |
144 | 'title' => ts('SMS Provider ID') , | |
145 | 'description' => 'SMS Provider ID', | |
146 | 'required' => true, | |
147 | ) , | |
148 | 'name' => array( | |
149 | 'name' => 'name', | |
150 | 'type' => CRM_Utils_Type::T_STRING, | |
151 | 'title' => ts('SMS Provider Name') , | |
152 | 'description' => 'Provider internal name points to option_value of option_group sms_provider_name', | |
153 | 'maxlength' => 64, | |
154 | 'size' => CRM_Utils_Type::BIG, | |
155 | ) , | |
156 | 'title' => array( | |
157 | 'name' => 'title', | |
158 | 'type' => CRM_Utils_Type::T_STRING, | |
159 | 'title' => ts('SMS Provider Title') , | |
160 | 'description' => 'Provider name visible to user', | |
161 | 'maxlength' => 64, | |
162 | 'size' => CRM_Utils_Type::BIG, | |
163 | 'html' => array( | |
164 | 'type' => 'Text', | |
165 | ) , | |
166 | ) , | |
167 | 'username' => array( | |
168 | 'name' => 'username', | |
169 | 'type' => CRM_Utils_Type::T_STRING, | |
170 | 'title' => ts('SMS Provider Username') , | |
171 | 'maxlength' => 255, | |
172 | 'size' => CRM_Utils_Type::HUGE, | |
173 | 'html' => array( | |
174 | 'type' => 'Text', | |
175 | ) , | |
176 | ) , | |
177 | 'password' => array( | |
178 | 'name' => 'password', | |
179 | 'type' => CRM_Utils_Type::T_STRING, | |
180 | 'title' => ts('SMS Provider Password') , | |
181 | 'maxlength' => 255, | |
182 | 'size' => CRM_Utils_Type::HUGE, | |
183 | 'html' => array( | |
184 | 'type' => 'Text', | |
185 | ) , | |
186 | ) , | |
187 | 'api_type' => array( | |
188 | 'name' => 'api_type', | |
189 | 'type' => CRM_Utils_Type::T_INT, | |
190 | 'title' => ts('SMS Provider API') , | |
191 | 'description' => 'points to value in civicrm_option_value for group sms_api_type', | |
192 | 'required' => true, | |
193 | 'html' => array( | |
194 | 'type' => 'Select', | |
195 | ) , | |
196 | ) , | |
197 | 'api_url' => array( | |
198 | 'name' => 'api_url', | |
199 | 'type' => CRM_Utils_Type::T_STRING, | |
200 | 'title' => ts('SMS Provider API URL') , | |
201 | 'maxlength' => 128, | |
202 | 'size' => CRM_Utils_Type::HUGE, | |
203 | 'html' => array( | |
204 | 'type' => 'Text', | |
205 | ) , | |
206 | ) , | |
207 | 'api_params' => array( | |
208 | 'name' => 'api_params', | |
209 | 'type' => CRM_Utils_Type::T_TEXT, | |
210 | 'title' => ts('SMS Provider API Params') , | |
211 | 'description' => 'the api params in xml, http or smtp format', | |
212 | 'html' => array( | |
213 | 'type' => 'Text', | |
214 | ) , | |
215 | ) , | |
216 | 'is_default' => array( | |
217 | 'name' => 'is_default', | |
218 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
219 | 'title' => ts('SMS Provider is Default?') , | |
220 | 'html' => array( | |
221 | 'type' => 'CheckBox', | |
222 | ) , | |
223 | ) , | |
224 | 'is_active' => array( | |
225 | 'name' => 'is_active', | |
226 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
227 | 'title' => ts('SMS Provider is Active?') , | |
228 | 'html' => array( | |
229 | 'type' => 'CheckBox', | |
230 | ) , | |
231 | ) , | |
232 | ); | |
233 | } | |
234 | return self::$_fields; | |
235 | } | |
236 | /** | |
237 | * Returns an array containing, for each field, the arary key used for that | |
238 | * field in self::$_fields. | |
239 | * | |
240 | * @return array | |
241 | */ | |
242 | static function &fieldKeys() { | |
243 | if (!(self::$_fieldKeys)) { | |
244 | self::$_fieldKeys = array( | |
245 | 'id' => 'id', | |
246 | 'name' => 'name', | |
247 | 'title' => 'title', | |
248 | 'username' => 'username', | |
249 | 'password' => 'password', | |
250 | 'api_type' => 'api_type', | |
251 | 'api_url' => 'api_url', | |
252 | 'api_params' => 'api_params', | |
253 | 'is_default' => 'is_default', | |
254 | 'is_active' => 'is_active', | |
255 | ); | |
256 | } | |
257 | return self::$_fieldKeys; | |
258 | } | |
259 | /** | |
260 | * Returns the names of this table | |
261 | * | |
262 | * @return string | |
263 | */ | |
264 | static function getTableName() { | |
265 | return self::$_tableName; | |
266 | } | |
267 | /** | |
268 | * Returns if this table needs to be logged | |
269 | * | |
270 | * @return boolean | |
271 | */ | |
272 | function getLog() { | |
273 | return self::$_log; | |
274 | } | |
275 | /** | |
276 | * Returns the list of fields that can be imported | |
277 | * | |
278 | * @param bool $prefix | |
279 | * | |
280 | * @return array | |
281 | */ | |
282 | static function &import($prefix = false) { | |
60808919 TO |
283 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'sms_provider', $prefix, array()); |
284 | return $r; | |
e501603b TO |
285 | } |
286 | /** | |
287 | * Returns the list of fields that can be exported | |
288 | * | |
289 | * @param bool $prefix | |
290 | * | |
291 | * @return array | |
292 | */ | |
293 | static function &export($prefix = false) { | |
60808919 TO |
294 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'sms_provider', $prefix, array()); |
295 | return $r; | |
e501603b TO |
296 | } |
297 | } |