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