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