3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Financial/PaymentToken.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:6b3810f34b7a2c1aacecfb67f1d09b42)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Financial_DAO_PaymentToken constructor.
40 class CRM_Financial_DAO_PaymentToken
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_payment_token';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * FK to Contact ID for the owner of the token
69 public $payment_processor_id;
71 * Externally provided token string
83 * Contact ID of token creator
89 * Date this token expires
95 * Email at the time of token creation. Useful for fraud forensics
101 * Billing first name at the time of token creation. Useful for fraud forensics
105 public $billing_first_name;
107 * Billing middle name at the time of token creation. Useful for fraud forensics
111 public $billing_middle_name;
113 * Billing last name at the time of token creation. Useful for fraud forensics
117 public $billing_last_name;
119 * Holds the part of the card number or account details that may be retained or displayed
123 public $masked_account_number;
125 * IP used when creating the token. Useful for fraud forensics
133 function __construct() {
134 $this->__table
= 'civicrm_payment_token';
135 parent
::__construct();
138 * Returns foreign keys and entity references.
141 * [CRM_Core_Reference_Interface]
143 static function getReferenceColumns() {
144 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
145 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
146 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
147 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', 'id');
148 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
149 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
151 return Civi
::$statics[__CLASS__
]['links'];
154 * Returns all the column names of this table
158 static function &fields() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
160 Civi
::$statics[__CLASS__
]['fields'] = array(
161 'payment_token_id' => array(
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Payment Token ID') ,
165 'description' => 'Payment Token ID',
167 'table_name' => 'civicrm_payment_token',
168 'entity' => 'PaymentToken',
169 'bao' => 'CRM_Financial_DAO_PaymentToken',
172 'contact_id' => array(
173 'name' => 'contact_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Contact ID') ,
176 'description' => 'FK to Contact ID for the owner of the token',
178 'table_name' => 'civicrm_payment_token',
179 'entity' => 'PaymentToken',
180 'bao' => 'CRM_Financial_DAO_PaymentToken',
182 'FKClassName' => 'CRM_Contact_DAO_Contact',
184 'payment_processor_id' => array(
185 'name' => 'payment_processor_id',
186 'type' => CRM_Utils_Type
::T_INT
,
187 'title' => ts('Payment Processor ID') ,
189 'table_name' => 'civicrm_payment_token',
190 'entity' => 'PaymentToken',
191 'bao' => 'CRM_Financial_DAO_PaymentToken',
193 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Token') ,
199 'description' => 'Externally provided token string',
202 'size' => CRM_Utils_Type
::HUGE
,
203 'table_name' => 'civicrm_payment_token',
204 'entity' => 'PaymentToken',
205 'bao' => 'CRM_Financial_DAO_PaymentToken',
208 'created_date' => array(
209 'name' => 'created_date',
210 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
211 'title' => ts('Created Date') ,
212 'description' => 'Date created',
213 'default' => 'CURRENT_TIMESTAMP',
214 'table_name' => 'civicrm_payment_token',
215 'entity' => 'PaymentToken',
216 'bao' => 'CRM_Financial_DAO_PaymentToken',
219 'created_id' => array(
220 'name' => 'created_id',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Created ID') ,
223 'description' => 'Contact ID of token creator',
224 'table_name' => 'civicrm_payment_token',
225 'entity' => 'PaymentToken',
226 'bao' => 'CRM_Financial_DAO_PaymentToken',
228 'FKClassName' => 'CRM_Contact_DAO_Contact',
230 'expiry_date' => array(
231 'name' => 'expiry_date',
232 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
233 'title' => ts('Expiry Date') ,
234 'description' => 'Date this token expires',
235 'table_name' => 'civicrm_payment_token',
236 'entity' => 'PaymentToken',
237 'bao' => 'CRM_Financial_DAO_PaymentToken',
242 'type' => CRM_Utils_Type
::T_STRING
,
243 'title' => ts('Email') ,
244 'description' => 'Email at the time of token creation. Useful for fraud forensics',
246 'size' => CRM_Utils_Type
::HUGE
,
247 'table_name' => 'civicrm_payment_token',
248 'entity' => 'PaymentToken',
249 'bao' => 'CRM_Financial_DAO_PaymentToken',
252 'billing_first_name' => array(
253 'name' => 'billing_first_name',
254 'type' => CRM_Utils_Type
::T_STRING
,
255 'title' => ts('Billing First Name') ,
256 'description' => 'Billing first name at the time of token creation. Useful for fraud forensics',
258 'size' => CRM_Utils_Type
::HUGE
,
259 'table_name' => 'civicrm_payment_token',
260 'entity' => 'PaymentToken',
261 'bao' => 'CRM_Financial_DAO_PaymentToken',
264 'billing_middle_name' => array(
265 'name' => 'billing_middle_name',
266 'type' => CRM_Utils_Type
::T_STRING
,
267 'title' => ts('Billing Middle Name') ,
268 'description' => 'Billing middle name at the time of token creation. Useful for fraud forensics',
270 'size' => CRM_Utils_Type
::HUGE
,
271 'table_name' => 'civicrm_payment_token',
272 'entity' => 'PaymentToken',
273 'bao' => 'CRM_Financial_DAO_PaymentToken',
276 'billing_last_name' => array(
277 'name' => 'billing_last_name',
278 'type' => CRM_Utils_Type
::T_STRING
,
279 'title' => ts('Billing Last Name') ,
280 'description' => 'Billing last name at the time of token creation. Useful for fraud forensics',
282 'size' => CRM_Utils_Type
::HUGE
,
283 'table_name' => 'civicrm_payment_token',
284 'entity' => 'PaymentToken',
285 'bao' => 'CRM_Financial_DAO_PaymentToken',
288 'masked_account_number' => array(
289 'name' => 'masked_account_number',
290 'type' => CRM_Utils_Type
::T_STRING
,
291 'title' => ts('Masked Account Number') ,
292 'description' => 'Holds the part of the card number or account details that may be retained or displayed',
294 'size' => CRM_Utils_Type
::HUGE
,
295 'table_name' => 'civicrm_payment_token',
296 'entity' => 'PaymentToken',
297 'bao' => 'CRM_Financial_DAO_PaymentToken',
300 'ip_address' => array(
301 'name' => 'ip_address',
302 'type' => CRM_Utils_Type
::T_STRING
,
303 'title' => ts('IP Address') ,
304 'description' => 'IP used when creating the token. Useful for fraud forensics',
306 'size' => CRM_Utils_Type
::HUGE
,
307 'table_name' => 'civicrm_payment_token',
308 'entity' => 'PaymentToken',
309 'bao' => 'CRM_Financial_DAO_PaymentToken',
313 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
315 return Civi
::$statics[__CLASS__
]['fields'];
318 * Return a mapping from field-name to the corresponding key (as used in fields()).
321 * Array(string $name => string $uniqueName).
323 static function &fieldKeys() {
324 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
325 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
327 return Civi
::$statics[__CLASS__
]['fieldKeys'];
330 * Returns the names of this table
334 static function getTableName() {
335 return self
::$_tableName;
338 * Returns if this table needs to be logged
346 * Returns the list of fields that can be imported
348 * @param bool $prefix
352 static function &import($prefix = false) {
353 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'payment_token', $prefix, array());
357 * Returns the list of fields that can be exported
359 * @param bool $prefix
363 static function &export($prefix = false) {
364 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'payment_token', $prefix, array());