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