Merge pull request #17668 from seamuslee001/intl_check
[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:1133a3c9eb58738c315a8509fea39d72)
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
35 */
36 public $id;
37
38 /**
39 * Payment Processor Type Name.
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Payment Processor Type Title.
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 bool
63 */
64 public $is_active;
65
66 /**
67 * Is this processor the default?
68 *
69 * @var bool
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
142 */
143 public $billing_mode;
144
145 /**
146 * Can process recurring contributions
147 *
148 * @var bool
149 */
150 public $is_recur;
151
152 /**
153 * Payment Type: Credit or Debit (deprecated)
154 *
155 * @var int
156 */
157 public $payment_type;
158
159 /**
160 * Payment Instrument ID
161 *
162 * @var int
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 Type variable name to be used in code'),
198 'description' => ts('Payment Processor Type Name.'),
199 'required' => TRUE,
200 'maxlength' => 64,
201 'size' => CRM_Utils_Type::BIG,
202 'where' => 'civicrm_payment_processor_type.name',
203 'table_name' => 'civicrm_payment_processor_type',
204 'entity' => 'PaymentProcessorType',
205 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
206 'localizable' => 0,
207 ],
208 'title' => [
209 'name' => 'title',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Payment Processor Type Title'),
212 'description' => ts('Payment Processor Type Title.'),
213 'required' => TRUE,
214 'maxlength' => 127,
215 'size' => CRM_Utils_Type::HUGE,
216 'where' => 'civicrm_payment_processor_type.title',
217 'table_name' => 'civicrm_payment_processor_type',
218 'entity' => 'PaymentProcessorType',
219 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
220 'localizable' => 0,
221 ],
222 'description' => [
223 'name' => 'description',
224 'type' => CRM_Utils_Type::T_STRING,
225 'title' => ts('Processor Type Description'),
226 'description' => ts('Payment Processor Description.'),
227 'maxlength' => 255,
228 'size' => CRM_Utils_Type::HUGE,
229 'where' => 'civicrm_payment_processor_type.description',
230 'table_name' => 'civicrm_payment_processor_type',
231 'entity' => 'PaymentProcessorType',
232 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
233 'localizable' => 0,
234 ],
235 'is_active' => [
236 'name' => 'is_active',
237 'type' => CRM_Utils_Type::T_BOOLEAN,
238 'title' => ts('Processor Type Is Active?'),
239 'description' => ts('Is this processor active?'),
240 'where' => 'civicrm_payment_processor_type.is_active',
241 'default' => '1',
242 'table_name' => 'civicrm_payment_processor_type',
243 'entity' => 'PaymentProcessorType',
244 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
245 'localizable' => 0,
246 ],
247 'is_default' => [
248 'name' => 'is_default',
249 'type' => CRM_Utils_Type::T_BOOLEAN,
250 'title' => ts('Processor Type is Default?'),
251 'description' => ts('Is this processor the default?'),
252 'where' => 'civicrm_payment_processor_type.is_default',
253 'default' => '0',
254 'table_name' => 'civicrm_payment_processor_type',
255 'entity' => 'PaymentProcessorType',
256 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
257 'localizable' => 0,
258 ],
259 'user_name_label' => [
260 'name' => 'user_name_label',
261 'type' => CRM_Utils_Type::T_STRING,
262 'title' => ts('Label for User Name if used'),
263 'maxlength' => 255,
264 'size' => CRM_Utils_Type::HUGE,
265 'where' => 'civicrm_payment_processor_type.user_name_label',
266 'table_name' => 'civicrm_payment_processor_type',
267 'entity' => 'PaymentProcessorType',
268 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
269 'localizable' => 0,
270 ],
271 'password_label' => [
272 'name' => 'password_label',
273 'type' => CRM_Utils_Type::T_STRING,
274 'title' => ts('Label for password'),
275 'maxlength' => 255,
276 'size' => CRM_Utils_Type::HUGE,
277 'where' => 'civicrm_payment_processor_type.password_label',
278 'table_name' => 'civicrm_payment_processor_type',
279 'entity' => 'PaymentProcessorType',
280 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
281 'localizable' => 0,
282 ],
283 'signature_label' => [
284 'name' => 'signature_label',
285 'type' => CRM_Utils_Type::T_STRING,
286 'title' => ts('Label for Signature'),
287 'maxlength' => 255,
288 'size' => CRM_Utils_Type::HUGE,
289 'where' => 'civicrm_payment_processor_type.signature_label',
290 'table_name' => 'civicrm_payment_processor_type',
291 'entity' => 'PaymentProcessorType',
292 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
293 'localizable' => 0,
294 ],
295 'subject_label' => [
296 'name' => 'subject_label',
297 'type' => CRM_Utils_Type::T_STRING,
298 'title' => ts('Label for Subject'),
299 'maxlength' => 255,
300 'size' => CRM_Utils_Type::HUGE,
301 'where' => 'civicrm_payment_processor_type.subject_label',
302 'table_name' => 'civicrm_payment_processor_type',
303 'entity' => 'PaymentProcessorType',
304 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
305 'localizable' => 0,
306 ],
307 'class_name' => [
308 'name' => 'class_name',
309 'type' => CRM_Utils_Type::T_STRING,
310 'title' => ts('Suffix for PHP class name implementation'),
311 'required' => TRUE,
312 'maxlength' => 255,
313 'size' => CRM_Utils_Type::HUGE,
314 'where' => 'civicrm_payment_processor_type.class_name',
315 'table_name' => 'civicrm_payment_processor_type',
316 'entity' => 'PaymentProcessorType',
317 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
318 'localizable' => 0,
319 ],
320 'url_site_default' => [
321 'name' => 'url_site_default',
322 'type' => CRM_Utils_Type::T_STRING,
323 'title' => ts('Default Live Site URL'),
324 'maxlength' => 255,
325 'size' => CRM_Utils_Type::HUGE,
326 'where' => 'civicrm_payment_processor_type.url_site_default',
327 'table_name' => 'civicrm_payment_processor_type',
328 'entity' => 'PaymentProcessorType',
329 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
330 'localizable' => 0,
331 ],
332 'url_api_default' => [
333 'name' => 'url_api_default',
334 'type' => CRM_Utils_Type::T_STRING,
335 'title' => ts('Default API Site URL'),
336 'maxlength' => 255,
337 'size' => CRM_Utils_Type::HUGE,
338 'where' => 'civicrm_payment_processor_type.url_api_default',
339 'table_name' => 'civicrm_payment_processor_type',
340 'entity' => 'PaymentProcessorType',
341 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
342 'localizable' => 0,
343 ],
344 'url_recur_default' => [
345 'name' => 'url_recur_default',
346 'type' => CRM_Utils_Type::T_STRING,
347 'title' => ts('Default Live Recurring Payments URL'),
348 'maxlength' => 255,
349 'size' => CRM_Utils_Type::HUGE,
350 'where' => 'civicrm_payment_processor_type.url_recur_default',
351 'table_name' => 'civicrm_payment_processor_type',
352 'entity' => 'PaymentProcessorType',
353 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
354 'localizable' => 0,
355 ],
356 'url_button_default' => [
357 'name' => 'url_button_default',
358 'type' => CRM_Utils_Type::T_STRING,
359 'title' => ts('Default Live Button URL'),
360 'maxlength' => 255,
361 'size' => CRM_Utils_Type::HUGE,
362 'where' => 'civicrm_payment_processor_type.url_button_default',
363 'table_name' => 'civicrm_payment_processor_type',
364 'entity' => 'PaymentProcessorType',
365 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
366 'localizable' => 0,
367 ],
368 'url_site_test_default' => [
369 'name' => 'url_site_test_default',
370 'type' => CRM_Utils_Type::T_STRING,
371 'title' => ts('Default Test Site URL'),
372 'maxlength' => 255,
373 'size' => CRM_Utils_Type::HUGE,
374 'where' => 'civicrm_payment_processor_type.url_site_test_default',
375 'table_name' => 'civicrm_payment_processor_type',
376 'entity' => 'PaymentProcessorType',
377 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
378 'localizable' => 0,
379 ],
380 'url_api_test_default' => [
381 'name' => 'url_api_test_default',
382 'type' => CRM_Utils_Type::T_STRING,
383 'title' => ts('Default Test API URL'),
384 'maxlength' => 255,
385 'size' => CRM_Utils_Type::HUGE,
386 'where' => 'civicrm_payment_processor_type.url_api_test_default',
387 'table_name' => 'civicrm_payment_processor_type',
388 'entity' => 'PaymentProcessorType',
389 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
390 'localizable' => 0,
391 ],
392 'url_recur_test_default' => [
393 'name' => 'url_recur_test_default',
394 'type' => CRM_Utils_Type::T_STRING,
395 'title' => ts('Default Test Recurring Payment URL'),
396 'maxlength' => 255,
397 'size' => CRM_Utils_Type::HUGE,
398 'where' => 'civicrm_payment_processor_type.url_recur_test_default',
399 'table_name' => 'civicrm_payment_processor_type',
400 'entity' => 'PaymentProcessorType',
401 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
402 'localizable' => 0,
403 ],
404 'url_button_test_default' => [
405 'name' => 'url_button_test_default',
406 'type' => CRM_Utils_Type::T_STRING,
407 'title' => ts('Default Test Button URL'),
408 'maxlength' => 255,
409 'size' => CRM_Utils_Type::HUGE,
410 'where' => 'civicrm_payment_processor_type.url_button_test_default',
411 'table_name' => 'civicrm_payment_processor_type',
412 'entity' => 'PaymentProcessorType',
413 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
414 'localizable' => 0,
415 ],
416 'billing_mode' => [
417 'name' => 'billing_mode',
418 'type' => CRM_Utils_Type::T_INT,
419 'title' => ts('Billing Mode'),
420 'description' => ts('Billing Mode (deprecated)'),
421 'required' => TRUE,
422 'where' => 'civicrm_payment_processor_type.billing_mode',
423 'table_name' => 'civicrm_payment_processor_type',
424 'entity' => 'PaymentProcessorType',
425 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
426 'localizable' => 0,
427 'html' => [
428 'type' => 'Select',
429 ],
430 'pseudoconstant' => [
431 'callback' => 'CRM_Core_SelectValues::billingMode',
432 ],
433 ],
434 'is_recur' => [
435 'name' => 'is_recur',
436 'type' => CRM_Utils_Type::T_BOOLEAN,
437 'title' => ts('Processor Type Supports Recurring?'),
438 'description' => ts('Can process recurring contributions'),
439 'where' => 'civicrm_payment_processor_type.is_recur',
440 'table_name' => 'civicrm_payment_processor_type',
441 'entity' => 'PaymentProcessorType',
442 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
443 'localizable' => 0,
444 ],
445 'payment_type' => [
446 'name' => 'payment_type',
447 'type' => CRM_Utils_Type::T_INT,
448 'title' => ts('Processor Type Payment Type'),
449 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
450 'where' => 'civicrm_payment_processor_type.payment_type',
451 'default' => '1',
452 'table_name' => 'civicrm_payment_processor_type',
453 'entity' => 'PaymentProcessorType',
454 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
455 'localizable' => 0,
456 ],
457 'payment_instrument_id' => [
458 'name' => 'payment_instrument_id',
459 'type' => CRM_Utils_Type::T_INT,
460 'title' => ts('Payment Method'),
461 'description' => ts('Payment Instrument ID'),
462 'where' => 'civicrm_payment_processor_type.payment_instrument_id',
463 'default' => '1',
464 'table_name' => 'civicrm_payment_processor_type',
465 'entity' => 'PaymentProcessorType',
466 'bao' => 'CRM_Financial_BAO_PaymentProcessorType',
467 'localizable' => 0,
468 'pseudoconstant' => [
469 'optionGroupName' => 'payment_instrument',
470 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
471 ],
472 ],
473 ];
474 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
475 }
476 return Civi::$statics[__CLASS__]['fields'];
477 }
478
479 /**
480 * Return a mapping from field-name to the corresponding key (as used in fields()).
481 *
482 * @return array
483 * Array(string $name => string $uniqueName).
484 */
485 public static function &fieldKeys() {
486 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
487 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
488 }
489 return Civi::$statics[__CLASS__]['fieldKeys'];
490 }
491
492 /**
493 * Returns the names of this table
494 *
495 * @return string
496 */
497 public static function getTableName() {
498 return self::$_tableName;
499 }
500
501 /**
502 * Returns if this table needs to be logged
503 *
504 * @return bool
505 */
506 public function getLog() {
507 return self::$_log;
508 }
509
510 /**
511 * Returns the list of fields that can be imported
512 *
513 * @param bool $prefix
514 *
515 * @return array
516 */
517 public static function &import($prefix = FALSE) {
518 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor_type', $prefix, []);
519 return $r;
520 }
521
522 /**
523 * Returns the list of fields that can be exported
524 *
525 * @param bool $prefix
526 *
527 * @return array
528 */
529 public static function &export($prefix = FALSE) {
530 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor_type', $prefix, []);
531 return $r;
532 }
533
534 /**
535 * Returns the list of indices
536 *
537 * @param bool $localize
538 *
539 * @return array
540 */
541 public static function indices($localize = TRUE) {
542 $indices = [
543 'UI_name' => [
544 'name' => 'UI_name',
545 'field' => [
546 0 => 'name',
547 ],
548 'localizable' => FALSE,
549 'unique' => TRUE,
550 'sig' => 'civicrm_payment_processor_type::1::name',
551 ],
552 ];
553 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
554 }
555
556 }