curious
[civicrm-core.git] / CRM / Financial / DAO / PaymentProcessor.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a541d72f9435b6ae2706d98cc01b1598)
10 */
11
12 /**
13 * Database access object for the PaymentProcessor entity.
14 */
15 class CRM_Financial_DAO_PaymentProcessor 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';
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 ID
36 *
37 * @var int
38 */
39 public $id;
40
41 /**
42 * Which Domain is this match entry for
43 *
44 * @var int
45 */
46 public $domain_id;
47
48 /**
49 * Payment Processor Name.
50 *
51 * @var string
52 */
53 public $name;
54
55 /**
56 * Payment Processor Descriptive Name.
57 *
58 * @var string
59 */
60 public $title;
61
62 /**
63 * Payment Processor Description.
64 *
65 * @var string
66 */
67 public $description;
68
69 /**
70 * @var int
71 */
72 public $payment_processor_type_id;
73
74 /**
75 * Is this processor active?
76 *
77 * @var bool
78 */
79 public $is_active;
80
81 /**
82 * Is this processor the default?
83 *
84 * @var bool
85 */
86 public $is_default;
87
88 /**
89 * Is this processor for a test site?
90 *
91 * @var bool
92 */
93 public $is_test;
94
95 /**
96 * @var string
97 */
98 public $user_name;
99
100 /**
101 * @var string
102 */
103 public $password;
104
105 /**
106 * @var text
107 */
108 public $signature;
109
110 /**
111 * @var string
112 */
113 public $url_site;
114
115 /**
116 * @var string
117 */
118 public $url_api;
119
120 /**
121 * @var string
122 */
123 public $url_recur;
124
125 /**
126 * @var string
127 */
128 public $url_button;
129
130 /**
131 * @var string
132 */
133 public $subject;
134
135 /**
136 * @var string
137 */
138 public $class_name;
139
140 /**
141 * Billing Mode (deprecated)
142 *
143 * @var int
144 */
145 public $billing_mode;
146
147 /**
148 * Can process recurring contributions
149 *
150 * @var bool
151 */
152 public $is_recur;
153
154 /**
155 * Payment Type: Credit or Debit (deprecated)
156 *
157 * @var int
158 */
159 public $payment_type;
160
161 /**
162 * Payment Instrument ID
163 *
164 * @var int
165 */
166 public $payment_instrument_id;
167
168 /**
169 * array of accepted credit card types
170 *
171 * @var text
172 */
173 public $accepted_credit_cards;
174
175 /**
176 * Class constructor.
177 */
178 public function __construct() {
179 $this->__table = 'civicrm_payment_processor';
180 parent::__construct();
181 }
182
183 /**
184 * Returns localized title of this entity.
185 *
186 * @param bool $plural
187 * Whether to return the plural version of the title.
188 */
189 public static function getEntityTitle($plural = FALSE) {
190 return $plural ? ts('Payment Processors') : ts('Payment Processor');
191 }
192
193 /**
194 * Returns foreign keys and entity references.
195 *
196 * @return array
197 * [CRM_Core_Reference_Interface]
198 */
199 public static function getReferenceColumns() {
200 if (!isset(Civi::$statics[__CLASS__]['links'])) {
201 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
202 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
203 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_processor_type_id', 'civicrm_payment_processor_type', 'id');
204 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
205 }
206 return Civi::$statics[__CLASS__]['links'];
207 }
208
209 /**
210 * Returns all the column names of this table
211 *
212 * @return array
213 */
214 public static function &fields() {
215 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
216 Civi::$statics[__CLASS__]['fields'] = [
217 'id' => [
218 'name' => 'id',
219 'type' => CRM_Utils_Type::T_INT,
220 'title' => ts('Payment Processor ID'),
221 'description' => ts('Payment Processor ID'),
222 'required' => TRUE,
223 'where' => 'civicrm_payment_processor.id',
224 'table_name' => 'civicrm_payment_processor',
225 'entity' => 'PaymentProcessor',
226 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
227 'localizable' => 0,
228 'html' => [
229 'type' => 'Number',
230 ],
231 'readonly' => TRUE,
232 'add' => '1.8',
233 ],
234 'domain_id' => [
235 'name' => 'domain_id',
236 'type' => CRM_Utils_Type::T_INT,
237 'title' => ts('Domain ID'),
238 'description' => ts('Which Domain is this match entry for'),
239 'required' => TRUE,
240 'where' => 'civicrm_payment_processor.domain_id',
241 'table_name' => 'civicrm_payment_processor',
242 'entity' => 'PaymentProcessor',
243 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
244 'localizable' => 0,
245 'FKClassName' => 'CRM_Core_DAO_Domain',
246 'html' => [
247 'label' => ts("Domain"),
248 ],
249 'pseudoconstant' => [
250 'table' => 'civicrm_domain',
251 'keyColumn' => 'id',
252 'labelColumn' => 'name',
253 ],
254 'add' => '3.0',
255 ],
256 'name' => [
257 'name' => 'name',
258 'type' => CRM_Utils_Type::T_STRING,
259 'title' => ts('Payment Processor'),
260 'description' => ts('Payment Processor Name.'),
261 'maxlength' => 64,
262 'size' => CRM_Utils_Type::BIG,
263 'where' => 'civicrm_payment_processor.name',
264 'table_name' => 'civicrm_payment_processor',
265 'entity' => 'PaymentProcessor',
266 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
267 'localizable' => 0,
268 'html' => [
269 'type' => 'Text',
270 ],
271 'add' => '1.8',
272 ],
273 'title' => [
274 'name' => 'title',
275 'type' => CRM_Utils_Type::T_STRING,
276 'title' => ts('Payment Processor Title'),
277 'description' => ts('Payment Processor Descriptive Name.'),
278 'maxlength' => 127,
279 'size' => CRM_Utils_Type::HUGE,
280 'where' => 'civicrm_payment_processor.title',
281 'table_name' => 'civicrm_payment_processor',
282 'entity' => 'PaymentProcessor',
283 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
284 'localizable' => 1,
285 'html' => [
286 'type' => 'Text',
287 ],
288 'add' => '5.13',
289 ],
290 'description' => [
291 'name' => 'description',
292 'type' => CRM_Utils_Type::T_STRING,
293 'title' => ts('Processor Description'),
294 'description' => ts('Payment Processor Description.'),
295 'maxlength' => 255,
296 'size' => CRM_Utils_Type::HUGE,
297 'where' => 'civicrm_payment_processor.description',
298 'table_name' => 'civicrm_payment_processor',
299 'entity' => 'PaymentProcessor',
300 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
301 'localizable' => 0,
302 'html' => [
303 'type' => 'Text',
304 ],
305 'add' => '1.8',
306 ],
307 'payment_processor_type_id' => [
308 'name' => 'payment_processor_type_id',
309 'type' => CRM_Utils_Type::T_INT,
310 'title' => ts('Type ID'),
311 'required' => TRUE,
312 'where' => 'civicrm_payment_processor.payment_processor_type_id',
313 'table_name' => 'civicrm_payment_processor',
314 'entity' => 'PaymentProcessor',
315 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
316 'localizable' => 0,
317 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessorType',
318 'html' => [
319 'label' => ts("Type"),
320 ],
321 'pseudoconstant' => [
322 'table' => 'civicrm_payment_processor_type',
323 'keyColumn' => 'id',
324 'labelColumn' => 'title',
325 ],
326 'add' => '4.3',
327 ],
328 'is_active' => [
329 'name' => 'is_active',
330 'type' => CRM_Utils_Type::T_BOOLEAN,
331 'title' => ts('Processor is Active?'),
332 'description' => ts('Is this processor active?'),
333 'where' => 'civicrm_payment_processor.is_active',
334 'default' => '1',
335 'table_name' => 'civicrm_payment_processor',
336 'entity' => 'PaymentProcessor',
337 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
338 'localizable' => 0,
339 'add' => '1.8',
340 ],
341 'is_default' => [
342 'name' => 'is_default',
343 'type' => CRM_Utils_Type::T_BOOLEAN,
344 'title' => ts('Processor Is Default?'),
345 'description' => ts('Is this processor the default?'),
346 'where' => 'civicrm_payment_processor.is_default',
347 'default' => '0',
348 'table_name' => 'civicrm_payment_processor',
349 'entity' => 'PaymentProcessor',
350 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
351 'localizable' => 0,
352 'add' => '1.8',
353 ],
354 'is_test' => [
355 'name' => 'is_test',
356 'type' => CRM_Utils_Type::T_BOOLEAN,
357 'title' => ts('Is Test Processor?'),
358 'description' => ts('Is this processor for a test site?'),
359 'where' => 'civicrm_payment_processor.is_test',
360 'default' => '0',
361 'table_name' => 'civicrm_payment_processor',
362 'entity' => 'PaymentProcessor',
363 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
364 'localizable' => 0,
365 'add' => '1.8',
366 ],
367 'user_name' => [
368 'name' => 'user_name',
369 'type' => CRM_Utils_Type::T_STRING,
370 'title' => ts('User Name'),
371 'maxlength' => 255,
372 'size' => CRM_Utils_Type::HUGE,
373 'where' => 'civicrm_payment_processor.user_name',
374 'table_name' => 'civicrm_payment_processor',
375 'entity' => 'PaymentProcessor',
376 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
377 'localizable' => 0,
378 'html' => [
379 'type' => 'Text',
380 ],
381 'add' => '1.8',
382 ],
383 'password' => [
384 'name' => 'password',
385 'type' => CRM_Utils_Type::T_STRING,
386 'title' => ts('Password'),
387 'maxlength' => 255,
388 'size' => CRM_Utils_Type::HUGE,
389 'where' => 'civicrm_payment_processor.password',
390 'table_name' => 'civicrm_payment_processor',
391 'entity' => 'PaymentProcessor',
392 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
393 'localizable' => 0,
394 'html' => [
395 'type' => 'Password',
396 ],
397 'add' => '1.8',
398 ],
399 'signature' => [
400 'name' => 'signature',
401 'type' => CRM_Utils_Type::T_TEXT,
402 'title' => ts('Signature'),
403 'rows' => 4,
404 'cols' => 40,
405 'where' => 'civicrm_payment_processor.signature',
406 'table_name' => 'civicrm_payment_processor',
407 'entity' => 'PaymentProcessor',
408 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
409 'localizable' => 0,
410 'html' => [
411 'type' => 'TextArea',
412 ],
413 'add' => '1.8',
414 ],
415 'url_site' => [
416 'name' => 'url_site',
417 'type' => CRM_Utils_Type::T_STRING,
418 'title' => ts('Site URL'),
419 'maxlength' => 255,
420 'size' => CRM_Utils_Type::HUGE,
421 'where' => 'civicrm_payment_processor.url_site',
422 'table_name' => 'civicrm_payment_processor',
423 'entity' => 'PaymentProcessor',
424 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
425 'localizable' => 0,
426 'html' => [
427 'type' => 'Text',
428 ],
429 'add' => '1.8',
430 ],
431 'url_api' => [
432 'name' => 'url_api',
433 'type' => CRM_Utils_Type::T_STRING,
434 'title' => ts('API URL'),
435 'maxlength' => 255,
436 'size' => CRM_Utils_Type::HUGE,
437 'where' => 'civicrm_payment_processor.url_api',
438 'table_name' => 'civicrm_payment_processor',
439 'entity' => 'PaymentProcessor',
440 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
441 'localizable' => 0,
442 'html' => [
443 'type' => 'Text',
444 ],
445 'add' => '1.8',
446 ],
447 'url_recur' => [
448 'name' => 'url_recur',
449 'type' => CRM_Utils_Type::T_STRING,
450 'title' => ts('Recurring Payments URL'),
451 'maxlength' => 255,
452 'size' => CRM_Utils_Type::HUGE,
453 'where' => 'civicrm_payment_processor.url_recur',
454 'table_name' => 'civicrm_payment_processor',
455 'entity' => 'PaymentProcessor',
456 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
457 'localizable' => 0,
458 'html' => [
459 'type' => 'Text',
460 ],
461 'add' => '1.8',
462 ],
463 'url_button' => [
464 'name' => 'url_button',
465 'type' => CRM_Utils_Type::T_STRING,
466 'title' => ts('Button URL'),
467 'maxlength' => 255,
468 'size' => CRM_Utils_Type::HUGE,
469 'where' => 'civicrm_payment_processor.url_button',
470 'table_name' => 'civicrm_payment_processor',
471 'entity' => 'PaymentProcessor',
472 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
473 'localizable' => 0,
474 'html' => [
475 'type' => 'Text',
476 ],
477 'add' => '1.8',
478 ],
479 'subject' => [
480 'name' => 'subject',
481 'type' => CRM_Utils_Type::T_STRING,
482 'title' => ts('Subject'),
483 'maxlength' => 255,
484 'size' => CRM_Utils_Type::HUGE,
485 'where' => 'civicrm_payment_processor.subject',
486 'table_name' => 'civicrm_payment_processor',
487 'entity' => 'PaymentProcessor',
488 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
489 'localizable' => 0,
490 'html' => [
491 'type' => 'Text',
492 ],
493 'add' => '1.8',
494 ],
495 'class_name' => [
496 'name' => 'class_name',
497 'type' => CRM_Utils_Type::T_STRING,
498 'title' => ts('Suffix for PHP class name implementation'),
499 'maxlength' => 255,
500 'size' => CRM_Utils_Type::HUGE,
501 'where' => 'civicrm_payment_processor.class_name',
502 'table_name' => 'civicrm_payment_processor',
503 'entity' => 'PaymentProcessor',
504 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
505 'localizable' => 0,
506 'add' => '1.8',
507 ],
508 'billing_mode' => [
509 'name' => 'billing_mode',
510 'type' => CRM_Utils_Type::T_INT,
511 'title' => ts('Processor Billing Mode'),
512 'description' => ts('Billing Mode (deprecated)'),
513 'required' => TRUE,
514 'where' => 'civicrm_payment_processor.billing_mode',
515 'table_name' => 'civicrm_payment_processor',
516 'entity' => 'PaymentProcessor',
517 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
518 'localizable' => 0,
519 'add' => '1.8',
520 ],
521 'is_recur' => [
522 'name' => 'is_recur',
523 'type' => CRM_Utils_Type::T_BOOLEAN,
524 'title' => ts('Processor Supports Recurring?'),
525 'description' => ts('Can process recurring contributions'),
526 'where' => 'civicrm_payment_processor.is_recur',
527 'table_name' => 'civicrm_payment_processor',
528 'entity' => 'PaymentProcessor',
529 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
530 'localizable' => 0,
531 'add' => '1.8',
532 ],
533 'payment_type' => [
534 'name' => 'payment_type',
535 'type' => CRM_Utils_Type::T_INT,
536 'title' => ts('Payment Type'),
537 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
538 'where' => 'civicrm_payment_processor.payment_type',
539 'default' => '1',
540 'table_name' => 'civicrm_payment_processor',
541 'entity' => 'PaymentProcessor',
542 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
543 'localizable' => 0,
544 'add' => '3.0',
545 ],
546 'payment_instrument_id' => [
547 'name' => 'payment_instrument_id',
548 'type' => CRM_Utils_Type::T_INT,
549 'title' => ts('Payment Method'),
550 'description' => ts('Payment Instrument ID'),
551 'where' => 'civicrm_payment_processor.payment_instrument_id',
552 'default' => '1',
553 'table_name' => 'civicrm_payment_processor',
554 'entity' => 'PaymentProcessor',
555 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
556 'localizable' => 0,
557 'pseudoconstant' => [
558 'optionGroupName' => 'payment_instrument',
559 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
560 ],
561 'add' => '4.7',
562 ],
563 'accepted_credit_cards' => [
564 'name' => 'accepted_credit_cards',
565 'type' => CRM_Utils_Type::T_TEXT,
566 'title' => ts('Accepted Credit Cards'),
567 'description' => ts('array of accepted credit card types'),
568 'where' => 'civicrm_payment_processor.accepted_credit_cards',
569 'default' => NULL,
570 'table_name' => 'civicrm_payment_processor',
571 'entity' => 'PaymentProcessor',
572 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
573 'localizable' => 0,
574 'serialize' => self::SERIALIZE_JSON,
575 'add' => '4.7',
576 ],
577 ];
578 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
579 }
580 return Civi::$statics[__CLASS__]['fields'];
581 }
582
583 /**
584 * Return a mapping from field-name to the corresponding key (as used in fields()).
585 *
586 * @return array
587 * Array(string $name => string $uniqueName).
588 */
589 public static function &fieldKeys() {
590 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
591 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
592 }
593 return Civi::$statics[__CLASS__]['fieldKeys'];
594 }
595
596 /**
597 * Returns the names of this table
598 *
599 * @return string
600 */
601 public static function getTableName() {
602 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
603 }
604
605 /**
606 * Returns if this table needs to be logged
607 *
608 * @return bool
609 */
610 public function getLog() {
611 return self::$_log;
612 }
613
614 /**
615 * Returns the list of fields that can be imported
616 *
617 * @param bool $prefix
618 *
619 * @return array
620 */
621 public static function &import($prefix = FALSE) {
622 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor', $prefix, []);
623 return $r;
624 }
625
626 /**
627 * Returns the list of fields that can be exported
628 *
629 * @param bool $prefix
630 *
631 * @return array
632 */
633 public static function &export($prefix = FALSE) {
634 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor', $prefix, []);
635 return $r;
636 }
637
638 /**
639 * Returns the list of indices
640 *
641 * @param bool $localize
642 *
643 * @return array
644 */
645 public static function indices($localize = TRUE) {
646 $indices = [
647 'UI_name_test_domain_id' => [
648 'name' => 'UI_name_test_domain_id',
649 'field' => [
650 0 => 'name',
651 1 => 'is_test',
652 2 => 'domain_id',
653 ],
654 'localizable' => FALSE,
655 'unique' => TRUE,
656 'sig' => 'civicrm_payment_processor::1::name::is_test::domain_id',
657 ],
658 ];
659 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
660 }
661
662 }