API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[civicrm-core.git] / CRM / Financial / DAO / PaymentProcessor.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
a9d0587b 9 * (GenCodeChecksum:625ab4ba983447ea3e236b48491eeed6)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the PaymentProcessor entity.
f41f0342 14 */
e501603b 15class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
fa45b5b9 22 public static $_tableName = 'civicrm_payment_processor';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 30
e501603b
TO
31 /**
32 * Payment Processor ID
33 *
e6ca0a57 34 * @var int
e501603b
TO
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * Which Domain is this match entry for
40 *
e6ca0a57 41 * @var int
e501603b
TO
42 */
43 public $domain_id;
c3fc2621 44
e501603b
TO
45 /**
46 * Payment Processor Name.
47 *
48 * @var string
49 */
50 public $name;
c3fc2621 51
63b162c6 52 /**
53 * Payment Processor Descriptive Name.
54 *
55 * @var string
56 */
57 public $title;
58
e501603b
TO
59 /**
60 * Payment Processor Description.
61 *
62 * @var string
63 */
64 public $description;
c3fc2621 65
e501603b 66 /**
e6ca0a57 67 * @var int
e501603b
TO
68 */
69 public $payment_processor_type_id;
c3fc2621 70
e501603b
TO
71 /**
72 * Is this processor active?
73 *
e6ca0a57 74 * @var bool
e501603b
TO
75 */
76 public $is_active;
c3fc2621 77
e501603b
TO
78 /**
79 * Is this processor the default?
80 *
e6ca0a57 81 * @var bool
e501603b
TO
82 */
83 public $is_default;
c3fc2621 84
e501603b
TO
85 /**
86 * Is this processor for a test site?
87 *
e6ca0a57 88 * @var bool
e501603b
TO
89 */
90 public $is_test;
c3fc2621 91
e501603b 92 /**
e501603b
TO
93 * @var string
94 */
95 public $user_name;
c3fc2621 96
e501603b 97 /**
e501603b
TO
98 * @var string
99 */
100 public $password;
c3fc2621 101
e501603b 102 /**
e501603b
TO
103 * @var text
104 */
105 public $signature;
c3fc2621 106
e501603b 107 /**
e501603b
TO
108 * @var string
109 */
110 public $url_site;
c3fc2621 111
e501603b 112 /**
e501603b
TO
113 * @var string
114 */
115 public $url_api;
c3fc2621 116
e501603b 117 /**
e501603b
TO
118 * @var string
119 */
120 public $url_recur;
c3fc2621 121
e501603b 122 /**
e501603b
TO
123 * @var string
124 */
125 public $url_button;
c3fc2621 126
e501603b 127 /**
e501603b
TO
128 * @var string
129 */
130 public $subject;
c3fc2621 131
e501603b 132 /**
e501603b
TO
133 * @var string
134 */
135 public $class_name;
c3fc2621 136
e501603b
TO
137 /**
138 * Billing Mode (deprecated)
139 *
e6ca0a57 140 * @var int
e501603b
TO
141 */
142 public $billing_mode;
c3fc2621 143
e501603b
TO
144 /**
145 * Can process recurring contributions
146 *
e6ca0a57 147 * @var bool
e501603b
TO
148 */
149 public $is_recur;
c3fc2621 150
e501603b
TO
151 /**
152 * Payment Type: Credit or Debit (deprecated)
153 *
e6ca0a57 154 * @var int
e501603b
TO
155 */
156 public $payment_type;
c3fc2621 157
e501603b
TO
158 /**
159 * Payment Instrument ID
160 *
e6ca0a57 161 * @var int
e501603b
TO
162 */
163 public $payment_instrument_id;
c3fc2621 164
cb5962bd
SL
165 /**
166 * array of accepted credit card types
167 *
168 * @var text
169 */
170 public $accepted_credit_cards;
c3fc2621 171
e501603b 172 /**
f41f0342 173 * Class constructor.
e501603b 174 */
c3fc2621 175 public function __construct() {
e501603b
TO
176 $this->__table = 'civicrm_payment_processor';
177 parent::__construct();
178 }
c3fc2621 179
449c4e6b
CW
180 /**
181 * Returns localized title of this entity.
182 */
183 public static function getEntityTitle() {
184 return ts('Payment Processors');
185 }
186
e501603b 187 /**
f41f0342 188 * Returns foreign keys and entity references.
e501603b
TO
189 *
190 * @return array
191 * [CRM_Core_Reference_Interface]
192 */
c3fc2621 193 public static function getReferenceColumns() {
346aaaba 194 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 195 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
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');
346aaaba 198 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 199 }
346aaaba 200 return Civi::$statics[__CLASS__]['links'];
e501603b 201 }
c3fc2621 202
e501603b
TO
203 /**
204 * Returns all the column names of this table
205 *
206 * @return array
207 */
c3fc2621 208 public static function &fields() {
346aaaba 209 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
210 Civi::$statics[__CLASS__]['fields'] = [
211 'id' => [
e501603b
TO
212 'name' => 'id',
213 'type' => CRM_Utils_Type::T_INT,
c3fc2621 214 'title' => ts('Payment Processor ID'),
215b423e 215 'description' => ts('Payment Processor ID'),
c3fc2621 216 'required' => TRUE,
a36434b9 217 'where' => 'civicrm_payment_processor.id',
522a26c9 218 'table_name' => 'civicrm_payment_processor',
219 'entity' => 'PaymentProcessor',
220 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 221 'localizable' => 0,
a9d0587b 222 'add' => '1.8',
c3fc2621
CW
223 ],
224 'domain_id' => [
e501603b
TO
225 'name' => 'domain_id',
226 'type' => CRM_Utils_Type::T_INT,
c3fc2621 227 'title' => ts('Payment Processor Domain'),
215b423e 228 'description' => ts('Which Domain is this match entry for'),
c3fc2621 229 'required' => TRUE,
a36434b9 230 'where' => 'civicrm_payment_processor.domain_id',
522a26c9 231 'table_name' => 'civicrm_payment_processor',
232 'entity' => 'PaymentProcessor',
233 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 234 'localizable' => 0,
e501603b 235 'FKClassName' => 'CRM_Core_DAO_Domain',
c3fc2621 236 'pseudoconstant' => [
e501603b
TO
237 'table' => 'civicrm_domain',
238 'keyColumn' => 'id',
239 'labelColumn' => 'name',
e6ca0a57 240 ],
a9d0587b 241 'add' => '3.0',
c3fc2621
CW
242 ],
243 'name' => [
e501603b
TO
244 'name' => 'name',
245 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 246 'title' => ts('Payment Processor'),
215b423e 247 'description' => ts('Payment Processor Name.'),
e501603b
TO
248 'maxlength' => 64,
249 'size' => CRM_Utils_Type::BIG,
a36434b9 250 'where' => 'civicrm_payment_processor.name',
522a26c9 251 'table_name' => 'civicrm_payment_processor',
252 'entity' => 'PaymentProcessor',
253 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
63b162c6 254 'localizable' => 0,
255 'html' => [
256 'type' => 'Text',
257 ],
a9d0587b 258 'add' => '1.8',
63b162c6 259 ],
260 'title' => [
261 'name' => 'title',
262 'type' => CRM_Utils_Type::T_STRING,
263 'title' => ts('Payment Processor Title'),
264 'description' => ts('Payment Processor Descriptive Name.'),
265 'maxlength' => 127,
266 'size' => CRM_Utils_Type::HUGE,
a36434b9 267 'where' => 'civicrm_payment_processor.title',
63b162c6 268 'table_name' => 'civicrm_payment_processor',
269 'entity' => 'PaymentProcessor',
270 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
4c257e17 271 'localizable' => 1,
c3fc2621 272 'html' => [
1d2a585a 273 'type' => 'Text',
c3fc2621 274 ],
a9d0587b 275 'add' => '5.13',
c3fc2621
CW
276 ],
277 'description' => [
e501603b
TO
278 'name' => 'description',
279 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 280 'title' => ts('Processor Description'),
215b423e 281 'description' => ts('Payment Processor Description.'),
e501603b
TO
282 'maxlength' => 255,
283 'size' => CRM_Utils_Type::HUGE,
a36434b9 284 'where' => 'civicrm_payment_processor.description',
522a26c9 285 'table_name' => 'civicrm_payment_processor',
286 'entity' => 'PaymentProcessor',
287 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 288 'localizable' => 0,
83376469 289 'html' => [
290 'type' => 'Text',
291 ],
a9d0587b 292 'add' => '1.8',
c3fc2621
CW
293 ],
294 'payment_processor_type_id' => [
e501603b
TO
295 'name' => 'payment_processor_type_id',
296 'type' => CRM_Utils_Type::T_INT,
c3fc2621 297 'title' => ts('Payment Processor Type ID'),
2f859d0a 298 'required' => TRUE,
a36434b9 299 'where' => 'civicrm_payment_processor.payment_processor_type_id',
522a26c9 300 'table_name' => 'civicrm_payment_processor',
301 'entity' => 'PaymentProcessor',
302 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 303 'localizable' => 0,
e501603b 304 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessorType',
c3fc2621 305 'pseudoconstant' => [
e501603b
TO
306 'table' => 'civicrm_payment_processor_type',
307 'keyColumn' => 'id',
308 'labelColumn' => 'title',
e6ca0a57 309 ],
a9d0587b 310 'add' => '4.3',
c3fc2621
CW
311 ],
312 'is_active' => [
e501603b
TO
313 'name' => 'is_active',
314 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 315 'title' => ts('Processor is Active?'),
215b423e 316 'description' => ts('Is this processor active?'),
a36434b9 317 'where' => 'civicrm_payment_processor.is_active',
2f859d0a 318 'default' => '1',
522a26c9 319 'table_name' => 'civicrm_payment_processor',
320 'entity' => 'PaymentProcessor',
321 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 322 'localizable' => 0,
a9d0587b 323 'add' => '1.8',
c3fc2621
CW
324 ],
325 'is_default' => [
e501603b
TO
326 'name' => 'is_default',
327 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 328 'title' => ts('Processor Is Default?'),
215b423e 329 'description' => ts('Is this processor the default?'),
a36434b9 330 'where' => 'civicrm_payment_processor.is_default',
2f859d0a 331 'default' => '0',
522a26c9 332 'table_name' => 'civicrm_payment_processor',
333 'entity' => 'PaymentProcessor',
334 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 335 'localizable' => 0,
a9d0587b 336 'add' => '1.8',
c3fc2621
CW
337 ],
338 'is_test' => [
e501603b
TO
339 'name' => 'is_test',
340 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 341 'title' => ts('Is Test Processor?'),
215b423e 342 'description' => ts('Is this processor for a test site?'),
a36434b9 343 'where' => 'civicrm_payment_processor.is_test',
2f859d0a 344 'default' => '0',
522a26c9 345 'table_name' => 'civicrm_payment_processor',
346 'entity' => 'PaymentProcessor',
347 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 348 'localizable' => 0,
a9d0587b 349 'add' => '1.8',
c3fc2621
CW
350 ],
351 'user_name' => [
e501603b
TO
352 'name' => 'user_name',
353 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 354 'title' => ts('User Name'),
e501603b
TO
355 'maxlength' => 255,
356 'size' => CRM_Utils_Type::HUGE,
a36434b9 357 'where' => 'civicrm_payment_processor.user_name',
522a26c9 358 'table_name' => 'civicrm_payment_processor',
359 'entity' => 'PaymentProcessor',
360 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 361 'localizable' => 0,
c3fc2621 362 'html' => [
1d2a585a 363 'type' => 'Text',
c3fc2621 364 ],
a9d0587b 365 'add' => '1.8',
c3fc2621
CW
366 ],
367 'password' => [
e501603b
TO
368 'name' => 'password',
369 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 370 'title' => ts('Password'),
e501603b
TO
371 'maxlength' => 255,
372 'size' => CRM_Utils_Type::HUGE,
a36434b9 373 'where' => 'civicrm_payment_processor.password',
522a26c9 374 'table_name' => 'civicrm_payment_processor',
375 'entity' => 'PaymentProcessor',
376 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 377 'localizable' => 0,
c3fc2621 378 'html' => [
dbb62458 379 'type' => 'Password',
c3fc2621 380 ],
a9d0587b 381 'add' => '1.8',
c3fc2621
CW
382 ],
383 'signature' => [
e501603b
TO
384 'name' => 'signature',
385 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 386 'title' => ts('Signature'),
1d2a585a 387 'rows' => 4,
388 'cols' => 40,
a36434b9 389 'where' => 'civicrm_payment_processor.signature',
522a26c9 390 'table_name' => 'civicrm_payment_processor',
391 'entity' => 'PaymentProcessor',
392 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 393 'localizable' => 0,
c3fc2621 394 'html' => [
1d2a585a 395 'type' => 'TextArea',
c3fc2621 396 ],
a9d0587b 397 'add' => '1.8',
c3fc2621
CW
398 ],
399 'url_site' => [
e501603b
TO
400 'name' => 'url_site',
401 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 402 'title' => ts('Site URL'),
e501603b
TO
403 'maxlength' => 255,
404 'size' => CRM_Utils_Type::HUGE,
a36434b9 405 'where' => 'civicrm_payment_processor.url_site',
522a26c9 406 'table_name' => 'civicrm_payment_processor',
407 'entity' => 'PaymentProcessor',
408 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 409 'localizable' => 0,
c3fc2621 410 'html' => [
1d2a585a 411 'type' => 'Text',
c3fc2621 412 ],
a9d0587b 413 'add' => '1.8',
c3fc2621
CW
414 ],
415 'url_api' => [
e501603b
TO
416 'name' => 'url_api',
417 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 418 'title' => ts('API URL'),
e501603b
TO
419 'maxlength' => 255,
420 'size' => CRM_Utils_Type::HUGE,
a36434b9 421 'where' => 'civicrm_payment_processor.url_api',
522a26c9 422 'table_name' => 'civicrm_payment_processor',
423 'entity' => 'PaymentProcessor',
424 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 425 'localizable' => 0,
c3fc2621 426 'html' => [
1d2a585a 427 'type' => 'Text',
c3fc2621 428 ],
a9d0587b 429 'add' => '1.8',
c3fc2621
CW
430 ],
431 'url_recur' => [
e501603b
TO
432 'name' => 'url_recur',
433 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 434 'title' => ts('Recurring Payments URL'),
e501603b
TO
435 'maxlength' => 255,
436 'size' => CRM_Utils_Type::HUGE,
a36434b9 437 'where' => 'civicrm_payment_processor.url_recur',
522a26c9 438 'table_name' => 'civicrm_payment_processor',
439 'entity' => 'PaymentProcessor',
440 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 441 'localizable' => 0,
c3fc2621 442 'html' => [
1d2a585a 443 'type' => 'Text',
c3fc2621 444 ],
a9d0587b 445 'add' => '1.8',
c3fc2621
CW
446 ],
447 'url_button' => [
e501603b
TO
448 'name' => 'url_button',
449 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 450 'title' => ts('Button URL'),
e501603b
TO
451 'maxlength' => 255,
452 'size' => CRM_Utils_Type::HUGE,
a36434b9 453 'where' => 'civicrm_payment_processor.url_button',
522a26c9 454 'table_name' => 'civicrm_payment_processor',
455 'entity' => 'PaymentProcessor',
456 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 457 'localizable' => 0,
c3fc2621 458 'html' => [
1d2a585a 459 'type' => 'Text',
c3fc2621 460 ],
a9d0587b 461 'add' => '1.8',
c3fc2621
CW
462 ],
463 'subject' => [
e501603b
TO
464 'name' => 'subject',
465 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 466 'title' => ts('Subject'),
e501603b
TO
467 'maxlength' => 255,
468 'size' => CRM_Utils_Type::HUGE,
a36434b9 469 'where' => 'civicrm_payment_processor.subject',
522a26c9 470 'table_name' => 'civicrm_payment_processor',
471 'entity' => 'PaymentProcessor',
472 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 473 'localizable' => 0,
c3fc2621 474 'html' => [
1d2a585a 475 'type' => 'Text',
c3fc2621 476 ],
a9d0587b 477 'add' => '1.8',
c3fc2621
CW
478 ],
479 'class_name' => [
e501603b
TO
480 'name' => 'class_name',
481 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 482 'title' => ts('Suffix for PHP class name implementation'),
e501603b
TO
483 'maxlength' => 255,
484 'size' => CRM_Utils_Type::HUGE,
a36434b9 485 'where' => 'civicrm_payment_processor.class_name',
522a26c9 486 'table_name' => 'civicrm_payment_processor',
487 'entity' => 'PaymentProcessor',
488 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 489 'localizable' => 0,
a9d0587b 490 'add' => '1.8',
c3fc2621
CW
491 ],
492 'billing_mode' => [
e501603b
TO
493 'name' => 'billing_mode',
494 'type' => CRM_Utils_Type::T_INT,
c3fc2621 495 'title' => ts('Processor Billing Mode'),
215b423e 496 'description' => ts('Billing Mode (deprecated)'),
c3fc2621 497 'required' => TRUE,
a36434b9 498 'where' => 'civicrm_payment_processor.billing_mode',
522a26c9 499 'table_name' => 'civicrm_payment_processor',
500 'entity' => 'PaymentProcessor',
501 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 502 'localizable' => 0,
a9d0587b 503 'add' => '1.8',
c3fc2621
CW
504 ],
505 'is_recur' => [
e501603b
TO
506 'name' => 'is_recur',
507 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 508 'title' => ts('Processor Supports Recurring?'),
215b423e 509 'description' => ts('Can process recurring contributions'),
a36434b9 510 'where' => 'civicrm_payment_processor.is_recur',
522a26c9 511 'table_name' => 'civicrm_payment_processor',
512 'entity' => 'PaymentProcessor',
513 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 514 'localizable' => 0,
a9d0587b 515 'add' => '1.8',
c3fc2621
CW
516 ],
517 'payment_type' => [
e501603b
TO
518 'name' => 'payment_type',
519 'type' => CRM_Utils_Type::T_INT,
c3fc2621 520 'title' => ts('Payment Type'),
215b423e 521 'description' => ts('Payment Type: Credit or Debit (deprecated)'),
a36434b9 522 'where' => 'civicrm_payment_processor.payment_type',
e501603b 523 'default' => '1',
522a26c9 524 'table_name' => 'civicrm_payment_processor',
525 'entity' => 'PaymentProcessor',
526 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 527 'localizable' => 0,
a9d0587b 528 'add' => '3.0',
c3fc2621
CW
529 ],
530 'payment_instrument_id' => [
e501603b
TO
531 'name' => 'payment_instrument_id',
532 'type' => CRM_Utils_Type::T_INT,
c3fc2621 533 'title' => ts('Payment Method'),
215b423e 534 'description' => ts('Payment Instrument ID'),
a36434b9 535 'where' => 'civicrm_payment_processor.payment_instrument_id',
e501603b 536 'default' => '1',
522a26c9 537 'table_name' => 'civicrm_payment_processor',
538 'entity' => 'PaymentProcessor',
539 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 540 'localizable' => 0,
c3fc2621 541 'pseudoconstant' => [
e501603b
TO
542 'optionGroupName' => 'payment_instrument',
543 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
e6ca0a57 544 ],
a9d0587b 545 'add' => '4.7',
c3fc2621
CW
546 ],
547 'accepted_credit_cards' => [
cb5962bd
SL
548 'name' => 'accepted_credit_cards',
549 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 550 'title' => ts('Accepted Credit Cards'),
215b423e 551 'description' => ts('array of accepted credit card types'),
a36434b9 552 'where' => 'civicrm_payment_processor.accepted_credit_cards',
cb5962bd 553 'default' => 'NULL',
522a26c9 554 'table_name' => 'civicrm_payment_processor',
555 'entity' => 'PaymentProcessor',
556 'bao' => 'CRM_Financial_BAO_PaymentProcessor',
6a7e5e5d 557 'localizable' => 0,
2a5c9b4d 558 'serialize' => self::SERIALIZE_JSON,
a9d0587b 559 'add' => '4.7',
c3fc2621
CW
560 ],
561 ];
346aaaba 562 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 563 }
346aaaba 564 return Civi::$statics[__CLASS__]['fields'];
e501603b 565 }
c3fc2621 566
e501603b 567 /**
bd8e0b14 568 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
569 *
570 * @return array
bd8e0b14 571 * Array(string $name => string $uniqueName).
e501603b 572 */
c3fc2621 573 public static function &fieldKeys() {
bd8e0b14
TO
574 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
575 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 576 }
bd8e0b14 577 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 578 }
c3fc2621 579
e501603b
TO
580 /**
581 * Returns the names of this table
582 *
583 * @return string
584 */
c3fc2621 585 public static function getTableName() {
4c257e17 586 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
e501603b 587 }
c3fc2621 588
e501603b
TO
589 /**
590 * Returns if this table needs to be logged
591 *
c3fc2621 592 * @return bool
e501603b 593 */
c3fc2621 594 public function getLog() {
e501603b
TO
595 return self::$_log;
596 }
c3fc2621 597
e501603b
TO
598 /**
599 * Returns the list of fields that can be imported
600 *
601 * @param bool $prefix
602 *
603 * @return array
604 */
c3fc2621
CW
605 public static function &import($prefix = FALSE) {
606 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'payment_processor', $prefix, []);
60808919 607 return $r;
e501603b 608 }
c3fc2621 609
e501603b
TO
610 /**
611 * Returns the list of fields that can be exported
612 *
613 * @param bool $prefix
614 *
615 * @return array
616 */
c3fc2621
CW
617 public static function &export($prefix = FALSE) {
618 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'payment_processor', $prefix, []);
60808919 619 return $r;
e501603b 620 }
c3fc2621 621
e7a6b91a
AS
622 /**
623 * Returns the list of indices
c3fc2621
CW
624 *
625 * @param bool $localize
626 *
627 * @return array
e7a6b91a
AS
628 */
629 public static function indices($localize = TRUE) {
c3fc2621
CW
630 $indices = [
631 'UI_name_test_domain_id' => [
e7a6b91a 632 'name' => 'UI_name_test_domain_id',
c3fc2621 633 'field' => [
e7a6b91a
AS
634 0 => 'name',
635 1 => 'is_test',
636 2 => 'domain_id',
c3fc2621
CW
637 ],
638 'localizable' => FALSE,
639 'unique' => TRUE,
e7a6b91a 640 'sig' => 'civicrm_payment_processor::1::name::is_test::domain_id',
c3fc2621
CW
641 ],
642 ];
e7a6b91a
AS
643 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
644 }
c3fc2621 645
e501603b 646}