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:5fc7f512cc85341d815456cf9c355797)
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',
171 'contact_id' => array(
172 'name' => 'contact_id',
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Contact ID') ,
175 'description' => 'FK to Contact ID for the owner of the token',
177 'table_name' => 'civicrm_payment_token',
178 'entity' => 'PaymentToken',
179 'bao' => 'CRM_Financial_DAO_PaymentToken',
180 'FKClassName' => 'CRM_Contact_DAO_Contact',
182 'payment_processor_id' => array(
183 'name' => 'payment_processor_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Payment Processor ID') ,
187 'table_name' => 'civicrm_payment_token',
188 'entity' => 'PaymentToken',
189 'bao' => 'CRM_Financial_DAO_PaymentToken',
190 'FKClassName' => 'CRM_Financial_DAO_PaymentProcessor',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Token') ,
196 'description' => 'Externally provided token string',
199 'size' => CRM_Utils_Type
::HUGE
,
200 'table_name' => 'civicrm_payment_token',
201 'entity' => 'PaymentToken',
202 'bao' => 'CRM_Financial_DAO_PaymentToken',
204 'created_date' => array(
205 'name' => 'created_date',
206 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
207 'title' => ts('Created Date') ,
208 'description' => 'Date created',
209 'default' => 'CURRENT_TIMESTAMP',
210 'table_name' => 'civicrm_payment_token',
211 'entity' => 'PaymentToken',
212 'bao' => 'CRM_Financial_DAO_PaymentToken',
214 'created_id' => array(
215 'name' => 'created_id',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Created ID') ,
218 'description' => 'Contact ID of token creator',
219 'table_name' => 'civicrm_payment_token',
220 'entity' => 'PaymentToken',
221 'bao' => 'CRM_Financial_DAO_PaymentToken',
222 'FKClassName' => 'CRM_Contact_DAO_Contact',
224 'expiry_date' => array(
225 'name' => 'expiry_date',
226 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
227 'title' => ts('Expiry Date') ,
228 'description' => 'Date this token expires',
229 'table_name' => 'civicrm_payment_token',
230 'entity' => 'PaymentToken',
231 'bao' => 'CRM_Financial_DAO_PaymentToken',
235 'type' => CRM_Utils_Type
::T_STRING
,
236 'title' => ts('Email') ,
237 'description' => 'Email at the time of token creation. Useful for fraud forensics',
239 'size' => CRM_Utils_Type
::HUGE
,
240 'table_name' => 'civicrm_payment_token',
241 'entity' => 'PaymentToken',
242 'bao' => 'CRM_Financial_DAO_PaymentToken',
244 'billing_first_name' => array(
245 'name' => 'billing_first_name',
246 'type' => CRM_Utils_Type
::T_STRING
,
247 'title' => ts('Billing First Name') ,
248 'description' => 'Billing first name at the time of token creation. Useful for fraud forensics',
250 'size' => CRM_Utils_Type
::HUGE
,
251 'table_name' => 'civicrm_payment_token',
252 'entity' => 'PaymentToken',
253 'bao' => 'CRM_Financial_DAO_PaymentToken',
255 'billing_middle_name' => array(
256 'name' => 'billing_middle_name',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('Billing Middle Name') ,
259 'description' => 'Billing middle name at the time of token creation. Useful for fraud forensics',
261 'size' => CRM_Utils_Type
::HUGE
,
262 'table_name' => 'civicrm_payment_token',
263 'entity' => 'PaymentToken',
264 'bao' => 'CRM_Financial_DAO_PaymentToken',
266 'billing_last_name' => array(
267 'name' => 'billing_last_name',
268 'type' => CRM_Utils_Type
::T_STRING
,
269 'title' => ts('Billing Last Name') ,
270 'description' => 'Billing last name at the time of token creation. Useful for fraud forensics',
272 'size' => CRM_Utils_Type
::HUGE
,
273 'table_name' => 'civicrm_payment_token',
274 'entity' => 'PaymentToken',
275 'bao' => 'CRM_Financial_DAO_PaymentToken',
277 'masked_account_number' => array(
278 'name' => 'masked_account_number',
279 'type' => CRM_Utils_Type
::T_STRING
,
280 'title' => ts('Masked Account Number') ,
281 'description' => 'Holds the part of the card number or account details that may be retained or displayed',
283 'size' => CRM_Utils_Type
::HUGE
,
284 'table_name' => 'civicrm_payment_token',
285 'entity' => 'PaymentToken',
286 'bao' => 'CRM_Financial_DAO_PaymentToken',
288 'ip_address' => array(
289 'name' => 'ip_address',
290 'type' => CRM_Utils_Type
::T_STRING
,
291 'title' => ts('IP Address') ,
292 'description' => 'IP used when creating the token. Useful for fraud forensics',
294 'size' => CRM_Utils_Type
::HUGE
,
295 'table_name' => 'civicrm_payment_token',
296 'entity' => 'PaymentToken',
297 'bao' => 'CRM_Financial_DAO_PaymentToken',
300 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
302 return Civi
::$statics[__CLASS__
]['fields'];
305 * Return a mapping from field-name to the corresponding key (as used in fields()).
308 * Array(string $name => string $uniqueName).
310 static function &fieldKeys() {
311 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
312 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
314 return Civi
::$statics[__CLASS__
]['fieldKeys'];
317 * Returns the names of this table
321 static function getTableName() {
322 return self
::$_tableName;
325 * Returns if this table needs to be logged
333 * Returns the list of fields that can be imported
335 * @param bool $prefix
339 static function &import($prefix = false) {
340 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'payment_token', $prefix, array());
344 * Returns the list of fields that can be exported
346 * @param bool $prefix
350 static function &export($prefix = false) {
351 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'payment_token', $prefix, array());