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