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