Merge pull request #12457 from omarabuhussein/dev/core#253
[civicrm-core.git] / CRM / Financial / DAO / PaymentProcessorType.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Financial/PaymentProcessorType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b8290611e8abcbd771b1006fd34e3ec5)
10 */
11
12 /**
13 * Database access object for the PaymentProcessorType entity.
14 */
15 class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_payment_processor_type';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = FALSE;
30
31 /**
32 * Payment Processor Type ID
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Payment Processor Name.
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Payment Processor Name.
47 *
48 * @var string
49 */
50 public $title;
51
52 /**
53 * Payment Processor Description.
54 *
55 * @var string
56 */
57 public $description;
58
59 /**
60 * Is this processor active?
61 *
62 * @var boolean
63 */
64 public $is_active;
65
66 /**
67 * Is this processor the default?
68 *
69 * @var boolean
70 */
71 public $is_default;
72
73 /**
74 * @var string
75 */
76 public $user_name_label;
77
78 /**
79 * @var string
80 */
81 public $password_label;
82
83 /**
84 * @var string
85 */
86 public $signature_label;
87
88 /**
89 * @var string
90 */
91 public $subject_label;
92
93 /**
94 * @var string
95 */
96 public $class_name;
97
98 /**
99 * @var string
100 */
101 public $url_site_default;
102
103 /**
104 * @var string
105 */
106 public $url_api_default;
107
108 /**
109 * @var string
110 */
111 public $url_recur_default;
112
113 /**
114 * @var string
115 */
116 public $url_button_default;
117
118 /**
119 * @var string
120 */
121 public $url_site_test_default;
122
123 /**
124 * @var string
125 */
126 public $url_api_test_default;
127
128 /**
129 * @var string
130 */
131 public $url_recur_test_default;
132
133 /**
134 * @var string
135 */
136 public $url_button_test_default;
137
138 /**
139 * Billing Mode (deprecated)
140 *
141 * @var int unsigned
142 */
143 public $billing_mode;
144
145 /**
146 * Can process recurring contributions
147 *
148 * @var boolean
149 */
150 public $is_recur;
151
152 /**
153 * Payment Type: Credit or Debit (deprecated)
154 *
155 * @var int unsigned
156 */
157 public $payment_type;
158
159 /**
160 * Payment Instrument ID
161 *
162 * @var int unsigned
163 */
164 public $payment_instrument_id;
165
166 /**
167 * Class constructor.
168 */
169 public function __construct() {
170 $this->__table = 'civicrm_payment_processor_type';
171 parent::__construct();
172 }
173
174 /**
175 * Returns all the column names of this table
176 *
177 * @return array
178 */
179 public static function &fields() {
180 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
181 Civi::$statics[__CLASS__]['fields'] = [
182 'id' => [
183 'name' => 'id',
184 'type' => CRM_Utils_Type::T_INT,
185 'title' => ts('Payment Processor Type ID'),
186 'description' => ts('Payment Processor Type ID'),
187 'required' => TRUE,
188 'table_name' => 'civicrm_payment_processor_type',
189 'entity' => 'PaymentProcessorType',
190 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
191 'localizable' => 0,
192 ],
193 'name' => [
194 'name' => 'name',
195 'type' => CRM_Utils_Type::T_STRING,
196 'title' => ts('Payment Processor variable name to be used in code'),
197 'description' => ts('Payment Processor Name.'),
198 'maxlength' => 64,
199 'size' => CRM_Utils_Type::BIG,
200 'table_name' => 'civicrm_payment_processor_type',
201 'entity' => 'PaymentProcessorType',
202 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
203 'localizable' => 0,
204 ],
205 'title' => [
206 'name' => 'title',
207 'type' => CRM_Utils_Type::T_STRING,
208 'title' => ts('Payment Processor Title'),
209 'description' => ts('Payment Processor Name.'),
210 'maxlength' => 127,
211 'size' => CRM_Utils_Type::HUGE,
212 'table_name' => 'civicrm_payment_processor_type',
213 'entity' => 'PaymentProcessorType',
214 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
215 'localizable' => 0,
216 ],
217 'description' => [
218 'name' => 'description',
219 'type' => CRM_Utils_Type::T_STRING,
220 'title' => ts('Processor Type Description'),
221 'description' => ts('Payment Processor Description.'),
222 'maxlength' => 255,
223 'size' => CRM_Utils_Type::HUGE,
224 'table_name' => 'civicrm_payment_processor_type',
225 'entity' => 'PaymentProcessorType',
226 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
227 'localizable' => 0,
228 ],
229 'is_active' => [
230 'name' => 'is_active',
231 'type' => CRM_Utils_Type::T_BOOLEAN,
232 'title' => ts('Processor Type Is Active?'),
233 'description' => ts('Is this processor active?'),
234 'table_name' => 'civicrm_payment_processor_type',
235 'entity' => 'PaymentProcessorType',
236 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
237 'localizable' => 0,
238 ],
239 'is_default' => [
240 'name' => 'is_default',
241 'type' => CRM_Utils_Type::T_BOOLEAN,
242 'title' => ts('Processor Type is Default?'),
243 'description' => ts('Is this processor the default?'),
244 'table_name' => 'civicrm_payment_processor_type',
245 'entity' => 'PaymentProcessorType',
246 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
247 'localizable' => 0,
248 ],
249 'user_name_label' => [
250 'name' => 'user_name_label',
251 'type' => CRM_Utils_Type::T_STRING,
252 'title' => ts('Label for User Name if used'),
253 'maxlength' => 255,
254 'size' => CRM_Utils_Type::HUGE,
255 'table_name' => 'civicrm_payment_processor_type',
256 'entity' => 'PaymentProcessorType',
257 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
258 'localizable' => 0,
259 ],
260 'password_label' => [
261 'name' => 'password_label',
262 'type' => CRM_Utils_Type::T_STRING,
263 'title' => ts('Label for password'),
264 'maxlength' => 255,
265 'size' => CRM_Utils_Type::HUGE,
266 'table_name' => 'civicrm_payment_processor_type',
267 'entity' => 'PaymentProcessorType',
268 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
269 'localizable' => 0,
270 ],
271 'signature_label' => [
272 'name' => 'signature_label',
273 'type' => CRM_Utils_Type::T_STRING,
274 'title' => ts('Label for Signature'),
275 'maxlength' => 255,
276 'size' => CRM_Utils_Type::HUGE,
277 'table_name' => 'civicrm_payment_processor_type',
278 'entity' => 'PaymentProcessorType',
279 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
280 'localizable' => 0,
281 ],
282 'subject_label' => [
283 'name' => 'subject_label',
284 'type' => CRM_Utils_Type::T_STRING,
285 'title' => ts('Label for Subject'),
286 'maxlength' => 255,
287 'size' => CRM_Utils_Type::HUGE,
288 'table_name' => 'civicrm_payment_processor_type',
289 'entity' => 'PaymentProcessorType',
290 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
291 'localizable' => 0,
292 ],
293 'class_name' => [
294 'name' => 'class_name',
295 'type' => CRM_Utils_Type::T_STRING,
296 'title' => ts('Suffix for PHP class name implementation'),
297 'maxlength' => 255,
298 'size' => CRM_Utils_Type::HUGE,
299 'table_name' => 'civicrm_payment_processor_type',
300 'entity' => 'PaymentProcessorType',
301 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
302 'localizable' => 0,
303 ],
304 'url_site_default' => [
305 'name' => 'url_site_default',
306 'type' => CRM_Utils_Type::T_STRING,
307 'title' => ts('Default Live Site URL'),
308 'maxlength' => 255,
309 'size' => CRM_Utils_Type::HUGE,
310 'table_name' => 'civicrm_payment_processor_type',
311 'entity' => 'PaymentProcessorType',
312 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
313 'localizable' => 0,
314 ],
315 'url_api_default' => [
316 'name' => 'url_api_default',
317 'type' => CRM_Utils_Type::T_STRING,
318 'title' => ts('Default API Site URL'),
319 'maxlength' => 255,
320 'size' => CRM_Utils_Type::HUGE,
321 'table_name' => 'civicrm_payment_processor_type',
322 'entity' => 'PaymentProcessorType',
323 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
324 'localizable' => 0,
325 ],
326 'url_recur_default' => [
327 'name' => 'url_recur_default',
328 'type' => CRM_Utils_Type::T_STRING,
329 'title' => ts('Default Live Recurring Payments URL'),
330 'maxlength' => 255,
331 'size' => CRM_Utils_Type::HUGE,
332 'table_name' => 'civicrm_payment_processor_type',
333 'entity' => 'PaymentProcessorType',
334 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
335 'localizable' => 0,
336 ],
337 'url_button_default' => [
338 'name' => 'url_button_default',
339 'type' => CRM_Utils_Type::T_STRING,
340 'title' => ts('Default Live Button URL'),
341 'maxlength' => 255,
342 'size' => CRM_Utils_Type::HUGE,
343 'table_name' => 'civicrm_payment_processor_type',
344 'entity' => 'PaymentProcessorType',
345 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
346 'localizable' => 0,
347 ],
348 'url_site_test_default' => [
349 'name' => 'url_site_test_default',
350 'type' => CRM_Utils_Type::T_STRING,
351 'title' => ts('Default Test Site URL'),
352 'maxlength' => 255,
353 'size' => CRM_Utils_Type::HUGE,
354 'table_name' => 'civicrm_payment_processor_type',
355 'entity' => 'PaymentProcessorType',
356 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
357 'localizable' => 0,
358 ],
359 'url_api_test_default' => [
360 'name' => 'url_api_test_default',
361 'type' => CRM_Utils_Type::T_STRING,
362 'title' => ts('Default Test API URL'),
363 'maxlength' => 255,
364 'size' => CRM_Utils_Type::HUGE,
365 'table_name' => 'civicrm_payment_processor_type',
366 'entity' => 'PaymentProcessorType',
367 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
368 'localizable' => 0,
369 ],
370 'url_recur_test_default' => [
371 'name' => 'url_recur_test_default',
372 'type' => CRM_Utils_Type::T_STRING,
373 'title' => ts('Default Test Recurring Payment URL'),
374 'maxlength' => 255,
375 'size' => CRM_Utils_Type::HUGE,
376 'table_name' => 'civicrm_payment_processor_type',
377 'entity' => 'PaymentProcessorType',
378 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
379 'localizable' => 0,
380 ],
381 'url_button_test_default' => [
382 'name' => 'url_button_test_default',
383 'type' => CRM_Utils_Type::T_STRING,
384 'title' => ts('Default Test Button URL'),
385 'maxlength' => 255,
386 'size' => CRM_Utils_Type::HUGE,
387 'table_name' => 'civicrm_payment_processor_type',
388 'entity' => 'PaymentProcessorType',
389 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
390 'localizable' => 0,
391 ],
392 'billing_mode' => [
393 'name' => 'billing_mode',
394 'type' => CRM_Utils_Type::T_INT,
395 'title' => ts('Billing Mode'),
396 'description' => ts('Billing Mode (deprecated)'),
397 'required' => TRUE,
398 'table_name' => 'civicrm_payment_processor_type',
399 'entity' => 'PaymentProcessorType',
400 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
401 'localizable' => 0,
402 'html' => [
403 'type' => 'Select',
404 ],
405 'pseudoconstant' => [
406 'callback' => 'CRM_Core_SelectValues::billingMode',
407 ]
408 ],
409 'is_recur' => [
410 'name' => 'is_recur',
411 'type' => CRM_Utils_Type::T_BOOLEAN,
412 'title' => ts('Processor Type Supports Recurring?'),
413 'description' => ts('Can process recurring contributions'),
414 'table_name' => 'civicrm_payment_processor_type',
415 'entity' => 'PaymentProcessorType',
416 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
417 'localizable' => 0,
418 ],
419 'payment_type' => [
420 'name' => 'payment_type',
421 'type' => CRM_Utils_Type::T_INT,
422 'title' => ts('Processor Type Payment Type'),
423 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
424 'default' => '1',
425 'table_name' => 'civicrm_payment_processor_type',
426 'entity' => 'PaymentProcessorType',
427 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
428 'localizable' => 0,
429 ],
430 'payment_instrument_id' => [
431 'name' => 'payment_instrument_id',
432 'type' => CRM_Utils_Type::T_INT,
433 'title' => ts('Payment Method'),
434 'description' => ts('Payment Instrument ID'),
435 'default' => '1',
436 'table_name' => 'civicrm_payment_processor_type',
437 'entity' => 'PaymentProcessorType',
438 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
439 'localizable' => 0,
440 'pseudoconstant' => [
441 'optionGroupName' => 'payment_instrument',
442 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
443 ]
444 ],
445 ];
446 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
447 }
448 return Civi::$statics[__CLASS__]['fields'];
449 }
450
451 /**
452 * Return a mapping from field-name to the corresponding key (as used in fields()).
453 *
454 * @return array
455 * Array(string $name => string $uniqueName).
456 */
457 public static function &fieldKeys() {
458 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
459 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
460 }
461 return Civi::$statics[__CLASS__]['fieldKeys'];
462 }
463
464 /**
465 * Returns the names of this table
466 *
467 * @return string
468 */
469 public static function getTableName() {
470 return self::$_tableName;
471 }
472
473 /**
474 * Returns if this table needs to be logged
475 *
476 * @return bool
477 */
478 public function getLog() {
479 return self::$_log;
480 }
481
482 /**
483 * Returns the list of fields that can be imported
484 *
485 * @param bool $prefix
486 *
487 * @return array
488 */
489 public static function &import($prefix = FALSE) {
490 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor_type', $prefix, []);
491 return $r;
492 }
493
494 /**
495 * Returns the list of fields that can be exported
496 *
497 * @param bool $prefix
498 *
499 * @return array
500 */
501 public static function &export($prefix = FALSE) {
502 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor_type', $prefix, []);
503 return $r;
504 }
505
506 /**
507 * Returns the list of indices
508 *
509 * @param bool $localize
510 *
511 * @return array
512 */
513 public static function indices($localize = TRUE) {
514 $indices = [
515 'UI_name' => [
516 'name' => 'UI_name',
517 'field' => [
518 0 => 'name',
519 ],
520 'localizable' => FALSE,
521 'unique' => TRUE,
522 'sig' => 'civicrm_payment_processor_type::1::name',
523 ],
524 ];
525 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
526 }
527
528 }