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