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