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