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