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