xml/templates/dao.tpl - Centralize export() / import() logic
[civicrm-core.git] / CRM / Financial / DAO / PaymentProcessor.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:a4b8d42c9958ae7f2ebf42fe036c3f3e)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_payment_processor';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 * Payment Processor ID
85 *
86 * @var int unsigned
87 */
88 public $id;
89 /**
90 * Which Domain is this match entry for
91 *
92 * @var int unsigned
93 */
94 public $domain_id;
95 /**
96 * Payment Processor Name.
97 *
98 * @var string
99 */
100 public $name;
101 /**
102 * Payment Processor Description.
103 *
104 * @var string
105 */
106 public $description;
107 /**
108 *
109 * @var int unsigned
110 */
111 public $payment_processor_type_id;
112 /**
113 * Is this processor active?
114 *
115 * @var boolean
116 */
117 public $is_active;
118 /**
119 * Is this processor the default?
120 *
121 * @var boolean
122 */
123 public $is_default;
124 /**
125 * Is this processor for a test site?
126 *
127 * @var boolean
128 */
129 public $is_test;
130 /**
131 *
132 * @var string
133 */
134 public $user_name;
135 /**
136 *
137 * @var string
138 */
139 public $password;
140 /**
141 *
142 * @var text
143 */
144 public $signature;
145 /**
146 *
147 * @var string
148 */
149 public $url_site;
150 /**
151 *
152 * @var string
153 */
154 public $url_api;
155 /**
156 *
157 * @var string
158 */
159 public $url_recur;
160 /**
161 *
162 * @var string
163 */
164 public $url_button;
165 /**
166 *
167 * @var string
168 */
169 public $subject;
170 /**
171 *
172 * @var string
173 */
174 public $class_name;
175 /**
176 * Billing Mode (deprecated)
177 *
178 * @var int unsigned
179 */
180 public $billing_mode;
181 /**
182 * Can process recurring contributions
183 *
184 * @var boolean
185 */
186 public $is_recur;
187 /**
188 * Payment Type: Credit or Debit (deprecated)
189 *
190 * @var int unsigned
191 */
192 public $payment_type;
193 /**
194 * Payment Instrument ID
195 *
196 * @var int unsigned
197 */
198 public $payment_instrument_id;
199 /**
200 * class constructor
201 *
202 * @return civicrm_payment_processor
203 */
204 function __construct() {
205 $this->__table = 'civicrm_payment_processor';
206 parent::__construct();
207 }
208 /**
209 * Returns foreign keys and entity references
210 *
211 * @return array
212 * [CRM_Core_Reference_Interface]
213 */
214 static function getReferenceColumns() {
215 if (!self::$_links) {
216 self::$_links = static ::createReferenceColumns(__CLASS__);
217 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
218 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_type_id', 'civicrm_payment_processor_type', 'id');
219 }
220 return self::$_links;
221 }
222 /**
223 * Returns all the column names of this table
224 *
225 * @return array
226 */
227 static function &fields() {
228 if (!(self::$_fields)) {
229 self::$_fields = array(
230 'id' => array(
231 'name' => 'id',
232 'type' => CRM_Utils_Type::T_INT,
233 'title' => ts('Payment Processor ID') ,
234 'description' => 'Payment Processor ID',
235 'required' => true,
236 ) ,
237 'domain_id' => array(
238 'name' => 'domain_id',
239 'type' => CRM_Utils_Type::T_INT,
240 'title' => ts('Payment Processor Domain') ,
241 'description' => 'Which Domain is this match entry for',
242 'required' => true,
243 'FKClassName' => 'CRM_Core_DAO_Domain',
244 'pseudoconstant' => array(
245 'table' => 'civicrm_domain',
246 'keyColumn' => 'id',
247 'labelColumn' => 'name',
248 )
249 ) ,
250 'name' => array(
251 'name' => 'name',
252 'type' => CRM_Utils_Type::T_STRING,
253 'title' => ts('Payment Processor') ,
254 'description' => 'Payment Processor Name.',
255 'maxlength' => 64,
256 'size' => CRM_Utils_Type::BIG,
257 ) ,
258 'description' => array(
259 'name' => 'description',
260 'type' => CRM_Utils_Type::T_STRING,
261 'title' => ts('Processor Description') ,
262 'description' => 'Payment Processor Description.',
263 'maxlength' => 255,
264 'size' => CRM_Utils_Type::HUGE,
265 ) ,
266 'payment_processor_type_id' => array(
267 'name' => 'payment_processor_type_id',
268 'type' => CRM_Utils_Type::T_INT,
269 'title' => ts('Payment Processor Type ID') ,
270 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessorType',
271 'pseudoconstant' => array(
272 'table' => 'civicrm_payment_processor_type',
273 'keyColumn' => 'id',
274 'labelColumn' => 'title',
275 )
276 ) ,
277 'is_active' => array(
278 'name' => 'is_active',
279 'type' => CRM_Utils_Type::T_BOOLEAN,
280 'title' => ts('Processor is Active?') ,
281 'description' => 'Is this processor active?',
282 ) ,
283 'is_default' => array(
284 'name' => 'is_default',
285 'type' => CRM_Utils_Type::T_BOOLEAN,
286 'title' => ts('Processor Is Default?') ,
287 'description' => 'Is this processor the default?',
288 ) ,
289 'is_test' => array(
290 'name' => 'is_test',
291 'type' => CRM_Utils_Type::T_BOOLEAN,
292 'title' => ts('Is Test Processor?') ,
293 'description' => 'Is this processor for a test site?',
294 ) ,
295 'user_name' => array(
296 'name' => 'user_name',
297 'type' => CRM_Utils_Type::T_STRING,
298 'title' => ts('User Name') ,
299 'maxlength' => 255,
300 'size' => CRM_Utils_Type::HUGE,
301 ) ,
302 'password' => array(
303 'name' => 'password',
304 'type' => CRM_Utils_Type::T_STRING,
305 'title' => ts('Password') ,
306 'maxlength' => 255,
307 'size' => CRM_Utils_Type::HUGE,
308 ) ,
309 'signature' => array(
310 'name' => 'signature',
311 'type' => CRM_Utils_Type::T_TEXT,
312 'title' => ts('Signature') ,
313 ) ,
314 'url_site' => array(
315 'name' => 'url_site',
316 'type' => CRM_Utils_Type::T_STRING,
317 'title' => ts('Site URL') ,
318 'maxlength' => 255,
319 'size' => CRM_Utils_Type::HUGE,
320 ) ,
321 'url_api' => array(
322 'name' => 'url_api',
323 'type' => CRM_Utils_Type::T_STRING,
324 'title' => ts('API URL') ,
325 'maxlength' => 255,
326 'size' => CRM_Utils_Type::HUGE,
327 ) ,
328 'url_recur' => array(
329 'name' => 'url_recur',
330 'type' => CRM_Utils_Type::T_STRING,
331 'title' => ts('Recurring Payments URL') ,
332 'maxlength' => 255,
333 'size' => CRM_Utils_Type::HUGE,
334 ) ,
335 'url_button' => array(
336 'name' => 'url_button',
337 'type' => CRM_Utils_Type::T_STRING,
338 'title' => ts('Button URL') ,
339 'maxlength' => 255,
340 'size' => CRM_Utils_Type::HUGE,
341 ) ,
342 'subject' => array(
343 'name' => 'subject',
344 'type' => CRM_Utils_Type::T_STRING,
345 'title' => ts('Subject') ,
346 'maxlength' => 255,
347 'size' => CRM_Utils_Type::HUGE,
348 ) ,
349 'class_name' => array(
350 'name' => 'class_name',
351 'type' => CRM_Utils_Type::T_STRING,
352 'title' => ts('Suffix for PHP class name implementation') ,
353 'maxlength' => 255,
354 'size' => CRM_Utils_Type::HUGE,
355 ) ,
356 'billing_mode' => array(
357 'name' => 'billing_mode',
358 'type' => CRM_Utils_Type::T_INT,
359 'title' => ts('Processor Billing Mode') ,
360 'description' => 'Billing Mode (deprecated)',
361 'required' => true,
362 ) ,
363 'is_recur' => array(
364 'name' => 'is_recur',
365 'type' => CRM_Utils_Type::T_BOOLEAN,
366 'title' => ts('Processor Supports Recurring?') ,
367 'description' => 'Can process recurring contributions',
368 ) ,
369 'payment_type' => array(
370 'name' => 'payment_type',
371 'type' => CRM_Utils_Type::T_INT,
372 'title' => ts('Payment Type') ,
373 'description' => 'Payment Type: Credit or Debit (deprecated)',
374 'default' => '1',
375 ) ,
376 'payment_instrument_id' => array(
377 'name' => 'payment_instrument_id',
378 'type' => CRM_Utils_Type::T_INT,
379 'title' => ts('Payment Method') ,
380 'description' => 'Payment Instrument ID',
381 'default' => '1',
382 'pseudoconstant' => array(
383 'optionGroupName' => 'payment_instrument',
384 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
385 )
386 ) ,
387 );
388 }
389 return self::$_fields;
390 }
391 /**
392 * Returns an array containing, for each field, the arary key used for that
393 * field in self::$_fields.
394 *
395 * @return array
396 */
397 static function &fieldKeys() {
398 if (!(self::$_fieldKeys)) {
399 self::$_fieldKeys = array(
400 'id' => 'id',
401 'domain_id' => 'domain_id',
402 'name' => 'name',
403 'description' => 'description',
404 'payment_processor_type_id' => 'payment_processor_type_id',
405 'is_active' => 'is_active',
406 'is_default' => 'is_default',
407 'is_test' => 'is_test',
408 'user_name' => 'user_name',
409 'password' => 'password',
410 'signature' => 'signature',
411 'url_site' => 'url_site',
412 'url_api' => 'url_api',
413 'url_recur' => 'url_recur',
414 'url_button' => 'url_button',
415 'subject' => 'subject',
416 'class_name' => 'class_name',
417 'billing_mode' => 'billing_mode',
418 'is_recur' => 'is_recur',
419 'payment_type' => 'payment_type',
420 'payment_instrument_id' => 'payment_instrument_id',
421 );
422 }
423 return self::$_fieldKeys;
424 }
425 /**
426 * Returns the names of this table
427 *
428 * @return string
429 */
430 static function getTableName() {
431 return self::$_tableName;
432 }
433 /**
434 * Returns if this table needs to be logged
435 *
436 * @return boolean
437 */
438 function getLog() {
439 return self::$_log;
440 }
441 /**
442 * Returns the list of fields that can be imported
443 *
444 * @param bool $prefix
445 *
446 * @return array
447 */
448 static function &import($prefix = false) {
449 if (!(self::$_import)) {
450 self::$_import = array();
451 $fields = self::fields();
452 foreach($fields as $name => $field) {
453 if (CRM_Utils_Array::value('import', $field)) {
454 if ($prefix) {
455 self::$_import['payment_processor'] = & $fields[$name];
456 } else {
457 self::$_import[$name] = & $fields[$name];
458 }
459 }
460 }
461 }
462 return self::$_import;
463 }
464 /**
465 * Returns the list of fields that can be exported
466 *
467 * @param bool $prefix
468 *
469 * @return array
470 */
471 static function &export($prefix = false) {
472 if (!(self::$_export)) {
473 self::$_export = array();
474 $fields = self::fields();
475 foreach($fields as $name => $field) {
476 if (CRM_Utils_Array::value('export', $field)) {
477 if ($prefix) {
478 self::$_export['payment_processor'] = & $fields[$name];
479 } else {
480 self::$_export[$name] = & $fields[$name];
481 }
482 }
483 }
484 }
485 return self::$_export;
486 }
487}