Merge pull request #14322 from AlainBenbassat/5.14
[civicrm-core.git] / CRM / Financial / DAO / PaymentProcessor.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:83f0467b531d70e84945e9c55a8824b6)
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 unsigned
35 */
36 public $id;
37
38 /**
39 * Which Domain is this match entry for
40 *
41 * @var int unsigned
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 unsigned
68 */
69 public $payment_processor_type_id;
70
71 /**
72 * Is this processor active?
73 *
74 * @var boolean
75 */
76 public $is_active;
77
78 /**
79 * Is this processor the default?
80 *
81 * @var boolean
82 */
83 public $is_default;
84
85 /**
86 * Is this processor for a test site?
87 *
88 * @var boolean
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 unsigned
141 */
142 public $billing_mode;
143
144 /**
145 * Can process recurring contributions
146 *
147 * @var boolean
148 */
149 public $is_recur;
150
151 /**
152 * Payment Type: Credit or Debit (deprecated)
153 *
154 * @var int unsigned
155 */
156 public $payment_type;
157
158 /**
159 * Payment Instrument ID
160 *
161 * @var int unsigned
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 foreign keys and entity references.
182 *
183 * @return array
184 * [CRM_Core_Reference_Interface]
185 */
186 public static function getReferenceColumns() {
187 if (!isset(Civi::$statics[__CLASS__]['links'])) {
188 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
189 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
190 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'payment_processor_type_id', 'civicrm_payment_processor_type', 'id');
191 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
192 }
193 return Civi::$statics[__CLASS__]['links'];
194 }
195
196 /**
197 * Returns all the column names of this table
198 *
199 * @return array
200 */
201 public static function &fields() {
202 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
203 Civi::$statics[__CLASS__]['fields'] = [
204 'id' => [
205 'name' => 'id',
206 'type' => CRM_Utils_Type::T_INT,
207 'title' => ts('Payment Processor ID'),
208 'description' => ts('Payment Processor ID'),
209 'required' => TRUE,
210 'where' => 'civicrm_payment_processor.id',
211 'table_name' => 'civicrm_payment_processor',
212 'entity' => 'PaymentProcessor',
213 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
214 'localizable' => 0,
215 ],
216 'domain_id' => [
217 'name' => 'domain_id',
218 'type' => CRM_Utils_Type::T_INT,
219 'title' => ts('Payment Processor Domain'),
220 'description' => ts('Which Domain is this match entry for'),
221 'required' => TRUE,
222 'where' => 'civicrm_payment_processor.domain_id',
223 'table_name' => 'civicrm_payment_processor',
224 'entity' => 'PaymentProcessor',
225 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
226 'localizable' => 0,
227 'FKClassName' => 'CRM_Core_DAO_Domain',
228 'pseudoconstant' => [
229 'table' => 'civicrm_domain',
230 'keyColumn' => 'id',
231 'labelColumn' => 'name',
232 ]
233 ],
234 'name' => [
235 'name' => 'name',
236 'type' => CRM_Utils_Type::T_STRING,
237 'title' => ts('Payment Processor'),
238 'description' => ts('Payment Processor Name.'),
239 'maxlength' => 64,
240 'size' => CRM_Utils_Type::BIG,
241 'where' => 'civicrm_payment_processor.name',
242 'table_name' => 'civicrm_payment_processor',
243 'entity' => 'PaymentProcessor',
244 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
245 'localizable' => 0,
246 'html' => [
247 'type' => 'Text',
248 ],
249 ],
250 'title' => [
251 'name' => 'title',
252 'type' => CRM_Utils_Type::T_STRING,
253 'title' => ts('Payment Processor Title'),
254 'description' => ts('Payment Processor Descriptive Name.'),
255 'maxlength' => 127,
256 'size' => CRM_Utils_Type::HUGE,
257 'where' => 'civicrm_payment_processor.title',
258 'table_name' => 'civicrm_payment_processor',
259 'entity' => 'PaymentProcessor',
260 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
261 'localizable' => 1,
262 'html' => [
263 'type' => 'Text',
264 ],
265 ],
266 'description' => [
267 'name' => 'description',
268 'type' => CRM_Utils_Type::T_STRING,
269 'title' => ts('Processor Description'),
270 'description' => ts('Payment Processor Description.'),
271 'maxlength' => 255,
272 'size' => CRM_Utils_Type::HUGE,
273 'where' => 'civicrm_payment_processor.description',
274 'table_name' => 'civicrm_payment_processor',
275 'entity' => 'PaymentProcessor',
276 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
277 'localizable' => 0,
278 ],
279 'payment_processor_type_id' => [
280 'name' => 'payment_processor_type_id',
281 'type' => CRM_Utils_Type::T_INT,
282 'title' => ts('Payment Processor Type ID'),
283 'where' => 'civicrm_payment_processor.payment_processor_type_id',
284 'table_name' => 'civicrm_payment_processor',
285 'entity' => 'PaymentProcessor',
286 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
287 'localizable' => 0,
288 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessorType',
289 'pseudoconstant' => [
290 'table' => 'civicrm_payment_processor_type',
291 'keyColumn' => 'id',
292 'labelColumn' => 'title',
293 ]
294 ],
295 'is_active' => [
296 'name' => 'is_active',
297 'type' => CRM_Utils_Type::T_BOOLEAN,
298 'title' => ts('Processor is Active?'),
299 'description' => ts('Is this processor active?'),
300 'where' => 'civicrm_payment_processor.is_active',
301 'table_name' => 'civicrm_payment_processor',
302 'entity' => 'PaymentProcessor',
303 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
304 'localizable' => 0,
305 ],
306 'is_default' => [
307 'name' => 'is_default',
308 'type' => CRM_Utils_Type::T_BOOLEAN,
309 'title' => ts('Processor Is Default?'),
310 'description' => ts('Is this processor the default?'),
311 'where' => 'civicrm_payment_processor.is_default',
312 'table_name' => 'civicrm_payment_processor',
313 'entity' => 'PaymentProcessor',
314 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
315 'localizable' => 0,
316 ],
317 'is_test' => [
318 'name' => 'is_test',
319 'type' => CRM_Utils_Type::T_BOOLEAN,
320 'title' => ts('Is Test Processor?'),
321 'description' => ts('Is this processor for a test site?'),
322 'where' => 'civicrm_payment_processor.is_test',
323 'table_name' => 'civicrm_payment_processor',
324 'entity' => 'PaymentProcessor',
325 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
326 'localizable' => 0,
327 ],
328 'user_name' => [
329 'name' => 'user_name',
330 'type' => CRM_Utils_Type::T_STRING,
331 'title' => ts('User Name'),
332 'maxlength' => 255,
333 'size' => CRM_Utils_Type::HUGE,
334 'where' => 'civicrm_payment_processor.user_name',
335 'table_name' => 'civicrm_payment_processor',
336 'entity' => 'PaymentProcessor',
337 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
338 'localizable' => 0,
339 'html' => [
340 'type' => 'Text',
341 ],
342 ],
343 'password' => [
344 'name' => 'password',
345 'type' => CRM_Utils_Type::T_STRING,
346 'title' => ts('Password'),
347 'maxlength' => 255,
348 'size' => CRM_Utils_Type::HUGE,
349 'where' => 'civicrm_payment_processor.password',
350 'table_name' => 'civicrm_payment_processor',
351 'entity' => 'PaymentProcessor',
352 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
353 'localizable' => 0,
354 'html' => [
355 'type' => 'Password',
356 ],
357 ],
358 'signature' => [
359 'name' => 'signature',
360 'type' => CRM_Utils_Type::T_TEXT,
361 'title' => ts('Signature'),
362 'rows' => 4,
363 'cols' => 40,
364 'where' => 'civicrm_payment_processor.signature',
365 'table_name' => 'civicrm_payment_processor',
366 'entity' => 'PaymentProcessor',
367 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
368 'localizable' => 0,
369 'html' => [
370 'type' => 'TextArea',
371 ],
372 ],
373 'url_site' => [
374 'name' => 'url_site',
375 'type' => CRM_Utils_Type::T_STRING,
376 'title' => ts('Site URL'),
377 'maxlength' => 255,
378 'size' => CRM_Utils_Type::HUGE,
379 'where' => 'civicrm_payment_processor.url_site',
380 'table_name' => 'civicrm_payment_processor',
381 'entity' => 'PaymentProcessor',
382 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
383 'localizable' => 0,
384 'html' => [
385 'type' => 'Text',
386 ],
387 ],
388 'url_api' => [
389 'name' => 'url_api',
390 'type' => CRM_Utils_Type::T_STRING,
391 'title' => ts('API URL'),
392 'maxlength' => 255,
393 'size' => CRM_Utils_Type::HUGE,
394 'where' => 'civicrm_payment_processor.url_api',
395 'table_name' => 'civicrm_payment_processor',
396 'entity' => 'PaymentProcessor',
397 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
398 'localizable' => 0,
399 'html' => [
400 'type' => 'Text',
401 ],
402 ],
403 'url_recur' => [
404 'name' => 'url_recur',
405 'type' => CRM_Utils_Type::T_STRING,
406 'title' => ts('Recurring Payments URL'),
407 'maxlength' => 255,
408 'size' => CRM_Utils_Type::HUGE,
409 'where' => 'civicrm_payment_processor.url_recur',
410 'table_name' => 'civicrm_payment_processor',
411 'entity' => 'PaymentProcessor',
412 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
413 'localizable' => 0,
414 'html' => [
415 'type' => 'Text',
416 ],
417 ],
418 'url_button' => [
419 'name' => 'url_button',
420 'type' => CRM_Utils_Type::T_STRING,
421 'title' => ts('Button URL'),
422 'maxlength' => 255,
423 'size' => CRM_Utils_Type::HUGE,
424 'where' => 'civicrm_payment_processor.url_button',
425 'table_name' => 'civicrm_payment_processor',
426 'entity' => 'PaymentProcessor',
427 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
428 'localizable' => 0,
429 'html' => [
430 'type' => 'Text',
431 ],
432 ],
433 'subject' => [
434 'name' => 'subject',
435 'type' => CRM_Utils_Type::T_STRING,
436 'title' => ts('Subject'),
437 'maxlength' => 255,
438 'size' => CRM_Utils_Type::HUGE,
439 'where' => 'civicrm_payment_processor.subject',
440 'table_name' => 'civicrm_payment_processor',
441 'entity' => 'PaymentProcessor',
442 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
443 'localizable' => 0,
444 'html' => [
445 'type' => 'Text',
446 ],
447 ],
448 'class_name' => [
449 'name' => 'class_name',
450 'type' => CRM_Utils_Type::T_STRING,
451 'title' => ts('Suffix for PHP class name implementation'),
452 'maxlength' => 255,
453 'size' => CRM_Utils_Type::HUGE,
454 'where' => 'civicrm_payment_processor.class_name',
455 'table_name' => 'civicrm_payment_processor',
456 'entity' => 'PaymentProcessor',
457 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
458 'localizable' => 0,
459 ],
460 'billing_mode' => [
461 'name' => 'billing_mode',
462 'type' => CRM_Utils_Type::T_INT,
463 'title' => ts('Processor Billing Mode'),
464 'description' => ts('Billing Mode (deprecated)'),
465 'required' => TRUE,
466 'where' => 'civicrm_payment_processor.billing_mode',
467 'table_name' => 'civicrm_payment_processor',
468 'entity' => 'PaymentProcessor',
469 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
470 'localizable' => 0,
471 ],
472 'is_recur' => [
473 'name' => 'is_recur',
474 'type' => CRM_Utils_Type::T_BOOLEAN,
475 'title' => ts('Processor Supports Recurring?'),
476 'description' => ts('Can process recurring contributions'),
477 'where' => 'civicrm_payment_processor.is_recur',
478 'table_name' => 'civicrm_payment_processor',
479 'entity' => 'PaymentProcessor',
480 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
481 'localizable' => 0,
482 ],
483 'payment_type' => [
484 'name' => 'payment_type',
485 'type' => CRM_Utils_Type::T_INT,
486 'title' => ts('Payment Type'),
487 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
488 'where' => 'civicrm_payment_processor.payment_type',
489 'default' => '1',
490 'table_name' => 'civicrm_payment_processor',
491 'entity' => 'PaymentProcessor',
492 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
493 'localizable' => 0,
494 ],
495 'payment_instrument_id' => [
496 'name' => 'payment_instrument_id',
497 'type' => CRM_Utils_Type::T_INT,
498 'title' => ts('Payment Method'),
499 'description' => ts('Payment Instrument ID'),
500 'where' => 'civicrm_payment_processor.payment_instrument_id',
501 'default' => '1',
502 'table_name' => 'civicrm_payment_processor',
503 'entity' => 'PaymentProcessor',
504 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
505 'localizable' => 0,
506 'pseudoconstant' => [
507 'optionGroupName' => 'payment_instrument',
508 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
509 ]
510 ],
511 'accepted_credit_cards' => [
512 'name' => 'accepted_credit_cards',
513 'type' => CRM_Utils_Type::T_TEXT,
514 'title' => ts('Accepted Credit Cards'),
515 'description' => ts('array of accepted credit card types'),
516 'where' => 'civicrm_payment_processor.accepted_credit_cards',
517 'default' => 'NULL',
518 'table_name' => 'civicrm_payment_processor',
519 'entity' => 'PaymentProcessor',
520 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
521 'localizable' => 0,
522 'serialize' => self::SERIALIZE_JSON,
523 ],
524 ];
525 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
526 }
527 return Civi::$statics[__CLASS__]['fields'];
528 }
529
530 /**
531 * Return a mapping from field-name to the corresponding key (as used in fields()).
532 *
533 * @return array
534 * Array(string $name => string $uniqueName).
535 */
536 public static function &fieldKeys() {
537 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
538 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
539 }
540 return Civi::$statics[__CLASS__]['fieldKeys'];
541 }
542
543 /**
544 * Returns the names of this table
545 *
546 * @return string
547 */
548 public static function getTableName() {
549 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
550 }
551
552 /**
553 * Returns if this table needs to be logged
554 *
555 * @return bool
556 */
557 public function getLog() {
558 return self::$_log;
559 }
560
561 /**
562 * Returns the list of fields that can be imported
563 *
564 * @param bool $prefix
565 *
566 * @return array
567 */
568 public static function &import($prefix = FALSE) {
569 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor', $prefix, []);
570 return $r;
571 }
572
573 /**
574 * Returns the list of fields that can be exported
575 *
576 * @param bool $prefix
577 *
578 * @return array
579 */
580 public static function &export($prefix = FALSE) {
581 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor', $prefix, []);
582 return $r;
583 }
584
585 /**
586 * Returns the list of indices
587 *
588 * @param bool $localize
589 *
590 * @return array
591 */
592 public static function indices($localize = TRUE) {
593 $indices = [
594 'UI_name_test_domain_id' => [
595 'name' => 'UI_name_test_domain_id',
596 'field' => [
597 0 => 'name',
598 1 => 'is_test',
599 2 => 'domain_id',
600 ],
601 'localizable' => FALSE,
602 'unique' => TRUE,
603 'sig' => 'civicrm_payment_processor::1::name::is_test::domain_id',
604 ],
605 ];
606 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
607 }
608
609 }