3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Financial/PaymentToken.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c605ea3935d538529bef1182880026ff)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Financial_DAO_PaymentToken
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_payment_token';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * FK to Contact ID for the owner of the token
99 public $payment_processor_id;
101 * Externally provided token string
111 public $created_date;
113 * Contact ID of token creator
119 * Date this token expires
125 * Email at the time of token creation. Useful for fraud forensics
131 * Billing first name at the time of token creation. Useful for fraud forensics
135 public $billing_first_name;
137 * Billing middle name at the time of token creation. Useful for fraud forensics
141 public $billing_middle_name;
143 * Billing last name at the time of token creation. Useful for fraud forensics
147 public $billing_last_name;
149 * Holds the part of the card number or account details that may be retained or displayed
153 public $masked_account_number;
155 * IP used when creating the token. Useful for fraud forensics
163 * @return civicrm_payment_token
165 function __construct() {
166 $this->__table
= 'civicrm_payment_token';
167 parent
::__construct();
170 * Returns foreign keys and entity references
173 * [CRM_Core_Reference_Interface]
175 static function getReferenceColumns() {
176 if (!self
::$_links) {
177 self
::$_links = static ::createReferenceColumns(__CLASS__
);
178 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
179 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', 'id');
180 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
182 return self
::$_links;
185 * Returns all the column names of this table
189 static function &fields() {
190 if (!(self
::$_fields)) {
191 self
::$_fields = array(
192 'payment_token_id' => array(
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Payment Token ID') ,
196 'description' => 'Payment Token ID',
199 'contact_id' => array(
200 'name' => 'contact_id',
201 'type' => CRM_Utils_Type
::T_INT
,
202 'title' => ts('Contact ID') ,
203 'description' => 'FK to Contact ID for the owner of the token',
205 'FKClassName' => 'CRM_Contact_DAO_Contact',
207 'payment_processor_id' => array(
208 'name' => 'payment_processor_id',
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('Payment Processor ID') ,
212 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
216 'type' => CRM_Utils_Type
::T_STRING
,
217 'title' => ts('Token') ,
218 'description' => 'Externally provided token string',
221 'size' => CRM_Utils_Type
::HUGE
,
223 'created_date' => array(
224 'name' => 'created_date',
225 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
226 'title' => ts('Created Date') ,
227 'description' => 'Date created',
228 'default' => 'CURRENT_TIMESTAMP',
230 'created_id' => array(
231 'name' => 'created_id',
232 'type' => CRM_Utils_Type
::T_INT
,
233 'title' => ts('Created ID') ,
234 'description' => 'Contact ID of token creator',
235 'FKClassName' => 'CRM_Contact_DAO_Contact',
237 'expiry_date' => array(
238 'name' => 'expiry_date',
239 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
240 'title' => ts('Expiry Date') ,
241 'description' => 'Date this token expires',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('Email') ,
247 'description' => 'Email at the time of token creation. Useful for fraud forensics',
249 'size' => CRM_Utils_Type
::HUGE
,
251 'billing_first_name' => array(
252 'name' => 'billing_first_name',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('Billing First Name') ,
255 'description' => 'Billing first name at the time of token creation. Useful for fraud forensics',
257 'size' => CRM_Utils_Type
::HUGE
,
259 'billing_middle_name' => array(
260 'name' => 'billing_middle_name',
261 'type' => CRM_Utils_Type
::T_STRING
,
262 'title' => ts('Billing Middle Name') ,
263 'description' => 'Billing middle name at the time of token creation. Useful for fraud forensics',
265 'size' => CRM_Utils_Type
::HUGE
,
267 'billing_last_name' => array(
268 'name' => 'billing_last_name',
269 'type' => CRM_Utils_Type
::T_STRING
,
270 'title' => ts('Billing Last Name') ,
271 'description' => 'Billing last name at the time of token creation. Useful for fraud forensics',
273 'size' => CRM_Utils_Type
::HUGE
,
275 'masked_account_number' => array(
276 'name' => 'masked_account_number',
277 'type' => CRM_Utils_Type
::T_STRING
,
278 'title' => ts('Masked Account Number') ,
279 'description' => 'Holds the part of the card number or account details that may be retained or displayed',
281 'size' => CRM_Utils_Type
::HUGE
,
283 'ip_address' => array(
284 'name' => 'ip_address',
285 'type' => CRM_Utils_Type
::T_STRING
,
286 'title' => ts('IP Address') ,
287 'description' => 'IP used when creating the token. Useful for fraud forensics',
289 'size' => CRM_Utils_Type
::HUGE
,
293 return self
::$_fields;
296 * Returns an array containing, for each field, the arary key used for that
297 * field in self::$_fields.
301 static function &fieldKeys() {
302 if (!(self
::$_fieldKeys)) {
303 self
::$_fieldKeys = array(
304 'id' => 'payment_token_id',
305 'contact_id' => 'contact_id',
306 'payment_processor_id' => 'payment_processor_id',
308 'created_date' => 'created_date',
309 'created_id' => 'created_id',
310 'expiry_date' => 'expiry_date',
312 'billing_first_name' => 'billing_first_name',
313 'billing_middle_name' => 'billing_middle_name',
314 'billing_last_name' => 'billing_last_name',
315 'masked_account_number' => 'masked_account_number',
316 'ip_address' => 'ip_address',
319 return self
::$_fieldKeys;
322 * Returns the names of this table
326 static function getTableName() {
327 return self
::$_tableName;
330 * Returns if this table needs to be logged
338 * Returns the list of fields that can be imported
340 * @param bool $prefix
344 static function &import($prefix = false) {
345 if (!(self
::$_import)) {
346 self
::$_import = array();
347 $fields = self
::fields();
348 foreach($fields as $name => $field) {
349 if (CRM_Utils_Array
::value('import', $field)) {
351 self
::$_import['payment_token'] = & $fields[$name];
353 self
::$_import[$name] = & $fields[$name];
358 return self
::$_import;
361 * Returns the list of fields that can be exported
363 * @param bool $prefix
367 static function &export($prefix = false) {
368 if (!(self
::$_export)) {
369 self
::$_export = array();
370 $fields = self
::fields();
371 foreach($fields as $name => $field) {
372 if (CRM_Utils_Array
::value('export', $field)) {
374 self
::$_export['payment_token'] = & $fields[$name];
376 self
::$_export[$name] = & $fields[$name];
381 return self
::$_export;