Add "labelField" metadata to entities
[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:8c42ca973c4031a67a5052682c3d73e7)
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 'add' => '1.8',
229 ],
230 'domain_id' => [
231 'name' => 'domain_id',
232 'type' => CRM_Utils_Type::T_INT,
233 'title' => ts('Payment Processor Domain'),
234 'description' => ts('Which Domain is this match entry for'),
235 'required' => TRUE,
236 'where' => 'civicrm_payment_processor.domain_id',
237 'table_name' => 'civicrm_payment_processor',
238 'entity' => 'PaymentProcessor',
239 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
240 'localizable' => 0,
241 'FKClassName' => 'CRM_Core_DAO_Domain',
242 'pseudoconstant' => [
243 'table' => 'civicrm_domain',
244 'keyColumn' => 'id',
245 'labelColumn' => 'name',
246 ],
247 'add' => '3.0',
248 ],
249 'name' => [
250 'name' => 'name',
251 'type' => CRM_Utils_Type::T_STRING,
252 'title' => ts('Payment Processor'),
253 'description' => ts('Payment Processor Name.'),
254 'maxlength' => 64,
255 'size' => CRM_Utils_Type::BIG,
256 'where' => 'civicrm_payment_processor.name',
257 'table_name' => 'civicrm_payment_processor',
258 'entity' => 'PaymentProcessor',
259 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
260 'localizable' => 0,
261 'html' => [
262 'type' => 'Text',
263 ],
264 'add' => '1.8',
265 ],
266 'title' => [
267 'name' => 'title',
268 'type' => CRM_Utils_Type::T_STRING,
269 'title' => ts('Payment Processor Title'),
270 'description' => ts('Payment Processor Descriptive Name.'),
271 'maxlength' => 127,
272 'size' => CRM_Utils_Type::HUGE,
273 'where' => 'civicrm_payment_processor.title',
274 'table_name' => 'civicrm_payment_processor',
275 'entity' => 'PaymentProcessor',
276 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
277 'localizable' => 1,
278 'html' => [
279 'type' => 'Text',
280 ],
281 'add' => '5.13',
282 ],
283 'description' => [
284 'name' => 'description',
285 'type' => CRM_Utils_Type::T_STRING,
286 'title' => ts('Processor Description'),
287 'description' => ts('Payment Processor Description.'),
288 'maxlength' => 255,
289 'size' => CRM_Utils_Type::HUGE,
290 'where' => 'civicrm_payment_processor.description',
291 'table_name' => 'civicrm_payment_processor',
292 'entity' => 'PaymentProcessor',
293 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
294 'localizable' => 0,
295 'html' => [
296 'type' => 'Text',
297 ],
298 'add' => '1.8',
299 ],
300 'payment_processor_type_id' => [
301 'name' => 'payment_processor_type_id',
302 'type' => CRM_Utils_Type::T_INT,
303 'title' => ts('Payment Processor Type ID'),
304 'required' => TRUE,
305 'where' => 'civicrm_payment_processor.payment_processor_type_id',
306 'table_name' => 'civicrm_payment_processor',
307 'entity' => 'PaymentProcessor',
308 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
309 'localizable' => 0,
310 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessorType',
311 'pseudoconstant' => [
312 'table' => 'civicrm_payment_processor_type',
313 'keyColumn' => 'id',
314 'labelColumn' => 'title',
315 ],
316 'add' => '4.3',
317 ],
318 'is_active' => [
319 'name' => 'is_active',
320 'type' => CRM_Utils_Type::T_BOOLEAN,
321 'title' => ts('Processor is Active?'),
322 'description' => ts('Is this processor active?'),
323 'where' => 'civicrm_payment_processor.is_active',
324 'default' => '1',
325 'table_name' => 'civicrm_payment_processor',
326 'entity' => 'PaymentProcessor',
327 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
328 'localizable' => 0,
329 'add' => '1.8',
330 ],
331 'is_default' => [
332 'name' => 'is_default',
333 'type' => CRM_Utils_Type::T_BOOLEAN,
334 'title' => ts('Processor Is Default?'),
335 'description' => ts('Is this processor the default?'),
336 'where' => 'civicrm_payment_processor.is_default',
337 'default' => '0',
338 'table_name' => 'civicrm_payment_processor',
339 'entity' => 'PaymentProcessor',
340 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
341 'localizable' => 0,
342 'add' => '1.8',
343 ],
344 'is_test' => [
345 'name' => 'is_test',
346 'type' => CRM_Utils_Type::T_BOOLEAN,
347 'title' => ts('Is Test Processor?'),
348 'description' => ts('Is this processor for a test site?'),
349 'where' => 'civicrm_payment_processor.is_test',
350 'default' => '0',
351 'table_name' => 'civicrm_payment_processor',
352 'entity' => 'PaymentProcessor',
353 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
354 'localizable' => 0,
355 'add' => '1.8',
356 ],
357 'user_name' => [
358 'name' => 'user_name',
359 'type' => CRM_Utils_Type::T_STRING,
360 'title' => ts('User Name'),
361 'maxlength' => 255,
362 'size' => CRM_Utils_Type::HUGE,
363 'where' => 'civicrm_payment_processor.user_name',
364 'table_name' => 'civicrm_payment_processor',
365 'entity' => 'PaymentProcessor',
366 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
367 'localizable' => 0,
368 'html' => [
369 'type' => 'Text',
370 ],
371 'add' => '1.8',
372 ],
373 'password' => [
374 'name' => 'password',
375 'type' => CRM_Utils_Type::T_STRING,
376 'title' => ts('Password'),
377 'maxlength' => 255,
378 'size' => CRM_Utils_Type::HUGE,
379 'where' => 'civicrm_payment_processor.password',
380 'table_name' => 'civicrm_payment_processor',
381 'entity' => 'PaymentProcessor',
382 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
383 'localizable' => 0,
384 'html' => [
385 'type' => 'Password',
386 ],
387 'add' => '1.8',
388 ],
389 'signature' => [
390 'name' => 'signature',
391 'type' => CRM_Utils_Type::T_TEXT,
392 'title' => ts('Signature'),
393 'rows' => 4,
394 'cols' => 40,
395 'where' => 'civicrm_payment_processor.signature',
396 'table_name' => 'civicrm_payment_processor',
397 'entity' => 'PaymentProcessor',
398 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
399 'localizable' => 0,
400 'html' => [
401 'type' => 'TextArea',
402 ],
403 'add' => '1.8',
404 ],
405 'url_site' => [
406 'name' => 'url_site',
407 'type' => CRM_Utils_Type::T_STRING,
408 'title' => ts('Site URL'),
409 'maxlength' => 255,
410 'size' => CRM_Utils_Type::HUGE,
411 'where' => 'civicrm_payment_processor.url_site',
412 'table_name' => 'civicrm_payment_processor',
413 'entity' => 'PaymentProcessor',
414 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
415 'localizable' => 0,
416 'html' => [
417 'type' => 'Text',
418 ],
419 'add' => '1.8',
420 ],
421 'url_api' => [
422 'name' => 'url_api',
423 'type' => CRM_Utils_Type::T_STRING,
424 'title' => ts('API URL'),
425 'maxlength' => 255,
426 'size' => CRM_Utils_Type::HUGE,
427 'where' => 'civicrm_payment_processor.url_api',
428 'table_name' => 'civicrm_payment_processor',
429 'entity' => 'PaymentProcessor',
430 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
431 'localizable' => 0,
432 'html' => [
433 'type' => 'Text',
434 ],
435 'add' => '1.8',
436 ],
437 'url_recur' => [
438 'name' => 'url_recur',
439 'type' => CRM_Utils_Type::T_STRING,
440 'title' => ts('Recurring Payments URL'),
441 'maxlength' => 255,
442 'size' => CRM_Utils_Type::HUGE,
443 'where' => 'civicrm_payment_processor.url_recur',
444 'table_name' => 'civicrm_payment_processor',
445 'entity' => 'PaymentProcessor',
446 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
447 'localizable' => 0,
448 'html' => [
449 'type' => 'Text',
450 ],
451 'add' => '1.8',
452 ],
453 'url_button' => [
454 'name' => 'url_button',
455 'type' => CRM_Utils_Type::T_STRING,
456 'title' => ts('Button URL'),
457 'maxlength' => 255,
458 'size' => CRM_Utils_Type::HUGE,
459 'where' => 'civicrm_payment_processor.url_button',
460 'table_name' => 'civicrm_payment_processor',
461 'entity' => 'PaymentProcessor',
462 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
463 'localizable' => 0,
464 'html' => [
465 'type' => 'Text',
466 ],
467 'add' => '1.8',
468 ],
469 'subject' => [
470 'name' => 'subject',
471 'type' => CRM_Utils_Type::T_STRING,
472 'title' => ts('Subject'),
473 'maxlength' => 255,
474 'size' => CRM_Utils_Type::HUGE,
475 'where' => 'civicrm_payment_processor.subject',
476 'table_name' => 'civicrm_payment_processor',
477 'entity' => 'PaymentProcessor',
478 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
479 'localizable' => 0,
480 'html' => [
481 'type' => 'Text',
482 ],
483 'add' => '1.8',
484 ],
485 'class_name' => [
486 'name' => 'class_name',
487 'type' => CRM_Utils_Type::T_STRING,
488 'title' => ts('Suffix for PHP class name implementation'),
489 'maxlength' => 255,
490 'size' => CRM_Utils_Type::HUGE,
491 'where' => 'civicrm_payment_processor.class_name',
492 'table_name' => 'civicrm_payment_processor',
493 'entity' => 'PaymentProcessor',
494 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
495 'localizable' => 0,
496 'add' => '1.8',
497 ],
498 'billing_mode' => [
499 'name' => 'billing_mode',
500 'type' => CRM_Utils_Type::T_INT,
501 'title' => ts('Processor Billing Mode'),
502 'description' => ts('Billing Mode (deprecated)'),
503 'required' => TRUE,
504 'where' => 'civicrm_payment_processor.billing_mode',
505 'table_name' => 'civicrm_payment_processor',
506 'entity' => 'PaymentProcessor',
507 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
508 'localizable' => 0,
509 'add' => '1.8',
510 ],
511 'is_recur' => [
512 'name' => 'is_recur',
513 'type' => CRM_Utils_Type::T_BOOLEAN,
514 'title' => ts('Processor Supports Recurring?'),
515 'description' => ts('Can process recurring contributions'),
516 'where' => 'civicrm_payment_processor.is_recur',
517 'table_name' => 'civicrm_payment_processor',
518 'entity' => 'PaymentProcessor',
519 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
520 'localizable' => 0,
521 'add' => '1.8',
522 ],
523 'payment_type' => [
524 'name' => 'payment_type',
525 'type' => CRM_Utils_Type::T_INT,
526 'title' => ts('Payment Type'),
527 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
528 'where' => 'civicrm_payment_processor.payment_type',
529 'default' => '1',
530 'table_name' => 'civicrm_payment_processor',
531 'entity' => 'PaymentProcessor',
532 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
533 'localizable' => 0,
534 'add' => '3.0',
535 ],
536 'payment_instrument_id' => [
537 'name' => 'payment_instrument_id',
538 'type' => CRM_Utils_Type::T_INT,
539 'title' => ts('Payment Method'),
540 'description' => ts('Payment Instrument ID'),
541 'where' => 'civicrm_payment_processor.payment_instrument_id',
542 'default' => '1',
543 'table_name' => 'civicrm_payment_processor',
544 'entity' => 'PaymentProcessor',
545 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
546 'localizable' => 0,
547 'pseudoconstant' => [
548 'optionGroupName' => 'payment_instrument',
549 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
550 ],
551 'add' => '4.7',
552 ],
553 'accepted_credit_cards' => [
554 'name' => 'accepted_credit_cards',
555 'type' => CRM_Utils_Type::T_TEXT,
556 'title' => ts('Accepted Credit Cards'),
557 'description' => ts('array of accepted credit card types'),
558 'where' => 'civicrm_payment_processor.accepted_credit_cards',
559 'default' => 'NULL',
560 'table_name' => 'civicrm_payment_processor',
561 'entity' => 'PaymentProcessor',
562 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
563 'localizable' => 0,
564 'serialize' => self::SERIALIZE_JSON,
565 'add' => '4.7',
566 ],
567 ];
568 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
569 }
570 return Civi::$statics[__CLASS__]['fields'];
571 }
572
573 /**
574 * Return a mapping from field-name to the corresponding key (as used in fields()).
575 *
576 * @return array
577 * Array(string $name => string $uniqueName).
578 */
579 public static function &fieldKeys() {
580 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
581 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
582 }
583 return Civi::$statics[__CLASS__]['fieldKeys'];
584 }
585
586 /**
587 * Returns the names of this table
588 *
589 * @return string
590 */
591 public static function getTableName() {
592 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
593 }
594
595 /**
596 * Returns if this table needs to be logged
597 *
598 * @return bool
599 */
600 public function getLog() {
601 return self::$_log;
602 }
603
604 /**
605 * Returns the list of fields that can be imported
606 *
607 * @param bool $prefix
608 *
609 * @return array
610 */
611 public static function &import($prefix = FALSE) {
612 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor', $prefix, []);
613 return $r;
614 }
615
616 /**
617 * Returns the list of fields that can be exported
618 *
619 * @param bool $prefix
620 *
621 * @return array
622 */
623 public static function &export($prefix = FALSE) {
624 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor', $prefix, []);
625 return $r;
626 }
627
628 /**
629 * Returns the list of indices
630 *
631 * @param bool $localize
632 *
633 * @return array
634 */
635 public static function indices($localize = TRUE) {
636 $indices = [
637 'UI_name_test_domain_id' => [
638 'name' => 'UI_name_test_domain_id',
639 'field' => [
640 0 => 'name',
641 1 => 'is_test',
642 2 => 'domain_id',
643 ],
644 'localizable' => FALSE,
645 'unique' => TRUE,
646 'sig' => 'civicrm_payment_processor::1::name::is_test::domain_id',
647 ],
648 ];
649 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
650 }
651
652 }