Merge pull request #19066 from colemanw/tabCleanup
[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:15dff8fa9ba4df684c09d6fb8c9f0430)
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 'add' => '1.8',
207 ],
208 'name' => [
209 'name' => 'name',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Payment Processor Type variable name to be used in code'),
212 'description' => ts('Payment Processor Type Name.'),
213 'required' => TRUE,
214 'maxlength' => 64,
215 'size' => CRM_Utils_Type::BIG,
216 'where' => 'civicrm_payment_processor_type.name',
217 'table_name' => 'civicrm_payment_processor_type',
218 'entity' => 'PaymentProcessorType',
219 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
220 'localizable' => 0,
221 'add' => '1.8',
222 ],
223 'title' => [
224 'name' => 'title',
225 'type' => CRM_Utils_Type::T_STRING,
226 'title' => ts('Payment Processor Type Title'),
227 'description' => ts('Payment Processor Type Title.'),
228 'required' => TRUE,
229 'maxlength' => 127,
230 'size' => CRM_Utils_Type::HUGE,
231 'where' => 'civicrm_payment_processor_type.title',
232 'table_name' => 'civicrm_payment_processor_type',
233 'entity' => 'PaymentProcessorType',
234 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
235 'localizable' => 0,
236 'add' => '1.8',
237 ],
238 'description' => [
239 'name' => 'description',
240 'type' => CRM_Utils_Type::T_STRING,
241 'title' => ts('Processor Type Description'),
242 'description' => ts('Payment Processor Description.'),
243 'maxlength' => 255,
244 'size' => CRM_Utils_Type::HUGE,
245 'where' => 'civicrm_payment_processor_type.description',
246 'table_name' => 'civicrm_payment_processor_type',
247 'entity' => 'PaymentProcessorType',
248 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
249 'localizable' => 0,
250 'add' => '1.8',
251 ],
252 'is_active' => [
253 'name' => 'is_active',
254 'type' => CRM_Utils_Type::T_BOOLEAN,
255 'title' => ts('Processor Type Is Active?'),
256 'description' => ts('Is this processor active?'),
257 'where' => 'civicrm_payment_processor_type.is_active',
258 'default' => '1',
259 'table_name' => 'civicrm_payment_processor_type',
260 'entity' => 'PaymentProcessorType',
261 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
262 'localizable' => 0,
263 'add' => '1.8',
264 ],
265 'is_default' => [
266 'name' => 'is_default',
267 'type' => CRM_Utils_Type::T_BOOLEAN,
268 'title' => ts('Processor Type is Default?'),
269 'description' => ts('Is this processor the default?'),
270 'where' => 'civicrm_payment_processor_type.is_default',
271 'default' => '0',
272 'table_name' => 'civicrm_payment_processor_type',
273 'entity' => 'PaymentProcessorType',
274 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
275 'localizable' => 0,
276 'add' => '1.8',
277 ],
278 'user_name_label' => [
279 'name' => 'user_name_label',
280 'type' => CRM_Utils_Type::T_STRING,
281 'title' => ts('Label for User Name if used'),
282 'maxlength' => 255,
283 'size' => CRM_Utils_Type::HUGE,
284 'where' => 'civicrm_payment_processor_type.user_name_label',
285 'table_name' => 'civicrm_payment_processor_type',
286 'entity' => 'PaymentProcessorType',
287 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
288 'localizable' => 0,
289 'add' => '1.8',
290 ],
291 'password_label' => [
292 'name' => 'password_label',
293 'type' => CRM_Utils_Type::T_STRING,
294 'title' => ts('Label for password'),
295 'maxlength' => 255,
296 'size' => CRM_Utils_Type::HUGE,
297 'where' => 'civicrm_payment_processor_type.password_label',
298 'table_name' => 'civicrm_payment_processor_type',
299 'entity' => 'PaymentProcessorType',
300 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
301 'localizable' => 0,
302 'add' => '1.8',
303 ],
304 'signature_label' => [
305 'name' => 'signature_label',
306 'type' => CRM_Utils_Type::T_STRING,
307 'title' => ts('Label for Signature'),
308 'maxlength' => 255,
309 'size' => CRM_Utils_Type::HUGE,
310 'where' => 'civicrm_payment_processor_type.signature_label',
311 'table_name' => 'civicrm_payment_processor_type',
312 'entity' => 'PaymentProcessorType',
313 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
314 'localizable' => 0,
315 'add' => '1.8',
316 ],
317 'subject_label' => [
318 'name' => 'subject_label',
319 'type' => CRM_Utils_Type::T_STRING,
320 'title' => ts('Label for Subject'),
321 'maxlength' => 255,
322 'size' => CRM_Utils_Type::HUGE,
323 'where' => 'civicrm_payment_processor_type.subject_label',
324 'table_name' => 'civicrm_payment_processor_type',
325 'entity' => 'PaymentProcessorType',
326 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
327 'localizable' => 0,
328 'add' => '1.8',
329 ],
330 'class_name' => [
331 'name' => 'class_name',
332 'type' => CRM_Utils_Type::T_STRING,
333 'title' => ts('Suffix for PHP class name implementation'),
334 'required' => TRUE,
335 'maxlength' => 255,
336 'size' => CRM_Utils_Type::HUGE,
337 'where' => 'civicrm_payment_processor_type.class_name',
338 'table_name' => 'civicrm_payment_processor_type',
339 'entity' => 'PaymentProcessorType',
340 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
341 'localizable' => 0,
342 'add' => '1.8',
343 ],
344 'url_site_default' => [
345 'name' => 'url_site_default',
346 'type' => CRM_Utils_Type::T_STRING,
347 'title' => ts('Default Live Site URL'),
348 'maxlength' => 255,
349 'size' => CRM_Utils_Type::HUGE,
350 'where' => 'civicrm_payment_processor_type.url_site_default',
351 'table_name' => 'civicrm_payment_processor_type',
352 'entity' => 'PaymentProcessorType',
353 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
354 'localizable' => 0,
355 'add' => '1.8',
356 ],
357 'url_api_default' => [
358 'name' => 'url_api_default',
359 'type' => CRM_Utils_Type::T_STRING,
360 'title' => ts('Default API Site URL'),
361 'maxlength' => 255,
362 'size' => CRM_Utils_Type::HUGE,
363 'where' => 'civicrm_payment_processor_type.url_api_default',
364 'table_name' => 'civicrm_payment_processor_type',
365 'entity' => 'PaymentProcessorType',
366 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
367 'localizable' => 0,
368 'add' => '1.8',
369 ],
370 'url_recur_default' => [
371 'name' => 'url_recur_default',
372 'type' => CRM_Utils_Type::T_STRING,
373 'title' => ts('Default Live Recurring Payments URL'),
374 'maxlength' => 255,
375 'size' => CRM_Utils_Type::HUGE,
376 'where' => 'civicrm_payment_processor_type.url_recur_default',
377 'table_name' => 'civicrm_payment_processor_type',
378 'entity' => 'PaymentProcessorType',
379 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
380 'localizable' => 0,
381 'add' => '1.8',
382 ],
383 'url_button_default' => [
384 'name' => 'url_button_default',
385 'type' => CRM_Utils_Type::T_STRING,
386 'title' => ts('Default Live Button URL'),
387 'maxlength' => 255,
388 'size' => CRM_Utils_Type::HUGE,
389 'where' => 'civicrm_payment_processor_type.url_button_default',
390 'table_name' => 'civicrm_payment_processor_type',
391 'entity' => 'PaymentProcessorType',
392 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
393 'localizable' => 0,
394 'add' => '1.8',
395 ],
396 'url_site_test_default' => [
397 'name' => 'url_site_test_default',
398 'type' => CRM_Utils_Type::T_STRING,
399 'title' => ts('Default Test Site URL'),
400 'maxlength' => 255,
401 'size' => CRM_Utils_Type::HUGE,
402 'where' => 'civicrm_payment_processor_type.url_site_test_default',
403 'table_name' => 'civicrm_payment_processor_type',
404 'entity' => 'PaymentProcessorType',
405 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
406 'localizable' => 0,
407 'add' => '1.8',
408 ],
409 'url_api_test_default' => [
410 'name' => 'url_api_test_default',
411 'type' => CRM_Utils_Type::T_STRING,
412 'title' => ts('Default Test API URL'),
413 'maxlength' => 255,
414 'size' => CRM_Utils_Type::HUGE,
415 'where' => 'civicrm_payment_processor_type.url_api_test_default',
416 'table_name' => 'civicrm_payment_processor_type',
417 'entity' => 'PaymentProcessorType',
418 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
419 'localizable' => 0,
420 'add' => '1.8',
421 ],
422 'url_recur_test_default' => [
423 'name' => 'url_recur_test_default',
424 'type' => CRM_Utils_Type::T_STRING,
425 'title' => ts('Default Test Recurring Payment URL'),
426 'maxlength' => 255,
427 'size' => CRM_Utils_Type::HUGE,
428 'where' => 'civicrm_payment_processor_type.url_recur_test_default',
429 'table_name' => 'civicrm_payment_processor_type',
430 'entity' => 'PaymentProcessorType',
431 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
432 'localizable' => 0,
433 'add' => '1.8',
434 ],
435 'url_button_test_default' => [
436 'name' => 'url_button_test_default',
437 'type' => CRM_Utils_Type::T_STRING,
438 'title' => ts('Default Test Button URL'),
439 'maxlength' => 255,
440 'size' => CRM_Utils_Type::HUGE,
441 'where' => 'civicrm_payment_processor_type.url_button_test_default',
442 'table_name' => 'civicrm_payment_processor_type',
443 'entity' => 'PaymentProcessorType',
444 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
445 'localizable' => 0,
446 'add' => '1.8',
447 ],
448 'billing_mode' => [
449 'name' => 'billing_mode',
450 'type' => CRM_Utils_Type::T_INT,
451 'title' => ts('Billing Mode'),
452 'description' => ts('Billing Mode (deprecated)'),
453 'required' => TRUE,
454 'where' => 'civicrm_payment_processor_type.billing_mode',
455 'table_name' => 'civicrm_payment_processor_type',
456 'entity' => 'PaymentProcessorType',
457 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
458 'localizable' => 0,
459 'html' => [
460 'type' => 'Select',
461 ],
462 'pseudoconstant' => [
463 'callback' => 'CRM_Core_SelectValues::billingMode',
464 ],
465 'add' => '1.8',
466 ],
467 'is_recur' => [
468 'name' => 'is_recur',
469 'type' => CRM_Utils_Type::T_BOOLEAN,
470 'title' => ts('Processor Type Supports Recurring?'),
471 'description' => ts('Can process recurring contributions'),
472 'where' => 'civicrm_payment_processor_type.is_recur',
473 'table_name' => 'civicrm_payment_processor_type',
474 'entity' => 'PaymentProcessorType',
475 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
476 'localizable' => 0,
477 'add' => '1.8',
478 ],
479 'payment_type' => [
480 'name' => 'payment_type',
481 'type' => CRM_Utils_Type::T_INT,
482 'title' => ts('Processor Type Payment Type'),
483 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
484 'where' => 'civicrm_payment_processor_type.payment_type',
485 'default' => '1',
486 'table_name' => 'civicrm_payment_processor_type',
487 'entity' => 'PaymentProcessorType',
488 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
489 'localizable' => 0,
490 'add' => '3.0',
491 ],
492 'payment_instrument_id' => [
493 'name' => 'payment_instrument_id',
494 'type' => CRM_Utils_Type::T_INT,
495 'title' => ts('Payment Method'),
496 'description' => ts('Payment Instrument ID'),
497 'where' => 'civicrm_payment_processor_type.payment_instrument_id',
498 'default' => '1',
499 'table_name' => 'civicrm_payment_processor_type',
500 'entity' => 'PaymentProcessorType',
501 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
502 'localizable' => 0,
503 'pseudoconstant' => [
504 'optionGroupName' => 'payment_instrument',
505 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
506 ],
507 'add' => '4.7',
508 ],
509 ];
510 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
511 }
512 return Civi::$statics[__CLASS__]['fields'];
513 }
514
515 /**
516 * Return a mapping from field-name to the corresponding key (as used in fields()).
517 *
518 * @return array
519 * Array(string $name => string $uniqueName).
520 */
521 public static function &fieldKeys() {
522 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
523 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
524 }
525 return Civi::$statics[__CLASS__]['fieldKeys'];
526 }
527
528 /**
529 * Returns the names of this table
530 *
531 * @return string
532 */
533 public static function getTableName() {
534 return self::$_tableName;
535 }
536
537 /**
538 * Returns if this table needs to be logged
539 *
540 * @return bool
541 */
542 public function getLog() {
543 return self::$_log;
544 }
545
546 /**
547 * Returns the list of fields that can be imported
548 *
549 * @param bool $prefix
550 *
551 * @return array
552 */
553 public static function &import($prefix = FALSE) {
554 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor_type', $prefix, []);
555 return $r;
556 }
557
558 /**
559 * Returns the list of fields that can be exported
560 *
561 * @param bool $prefix
562 *
563 * @return array
564 */
565 public static function &export($prefix = FALSE) {
566 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor_type', $prefix, []);
567 return $r;
568 }
569
570 /**
571 * Returns the list of indices
572 *
573 * @param bool $localize
574 *
575 * @return array
576 */
577 public static function indices($localize = TRUE) {
578 $indices = [
579 'UI_name' => [
580 'name' => 'UI_name',
581 'field' => [
582 0 => 'name',
583 ],
584 'localizable' => FALSE,
585 'unique' => TRUE,
586 'sig' => 'civicrm_payment_processor_type::1::name',
587 ],
588 ];
589 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
590 }
591
592 }