apache
wp-content
mu-plugins
plugins
activitypub
audioigniter
authldap
companion-auto-update
disable-wordpress-core-update
easy-digital-downloads
assets
includes
adjustments
admin
api
blocks
cart
checkout
compat
currency
customers
database
engine
queries
rows
schemas
class-adjustments.php
class-customer-addresses.php
class-customer-email-addresses.php
class-customers.php
class-logs-api-requests.php
class-logs-file-downloads.php
class-logs.php
class-notes.php
class-order-addresses.php
class-order-adjustments.php
class-order-items.php
class-order-transactions.php
class-orders.php
tables
NotificationsDB.php
README.md
downloads
emails
extensions
gateways
libraries
logs
models
notes
orders
payments
reports
traits
users
utils
EDD_SL_Plugin_Updater.php
actions.php
ajax-functions.php
class-base-object.php
class-component.php
class-easy-digital-downloads.php
class-edd-cache-helper.php
class-edd-cli.php
class-edd-cron.php
class-edd-customer-query.php
class-edd-customer.php
class-edd-db-customer-meta.php
class-edd-db-customers.php
class-edd-db.php
class-edd-discount.php
class-edd-download.php
class-edd-fees.php
class-edd-html-elements.php
class-edd-license-handler.php
class-edd-logging.php
class-edd-register-meta.php
class-edd-roles.php
class-edd-session.php
class-edd-stats.php
class-stats.php
class-structured-data.php
class-utilities.php
compat-functions.php
component-functions.php
country-functions.php
customer-functions.php
date-functions.php
deprecated-functions.php
deprecated-hooks.php
discount-functions.php
download-functions.php
error-tracking.php
formatting.php
install.php
interface-edd-exception.php
mime-types.php
misc-functions.php
plugin-compatibility.php
post-types.php
privacy-functions.php
process-download.php
process-purchase.php
query-filters.php
refund-functions.php
scripts.php
shortcodes.php
tax-functions.php
template-actions.php
template-functions.php
theme-compatibility.php
user-functions.php
widgets.php
languages
templates
easy-digital-downloads.php
license.txt
readme.txt
uninstall.php
gitium
gp-premium
jetpack-protect
menu-icons
simple-local-avatars
smtp-mailer
two-factor
wp-piwik
wp-webauthn
index.php
themes
index.php
.dbsetup
.gitignore
htaccess
php.ini
256 lines
4.7 KiB
PHP
256 lines
4.7 KiB
PHP
<?php
|
|
/**
|
|
* Orders Schema Class.
|
|
*
|
|
* @package EDD
|
|
* @subpackage Database\Schemas
|
|
* @copyright Copyright (c) 2018, Easy Digital Downloads, LLC
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
|
* @since 3.0
|
|
*/
|
|
namespace EDD\Database\Schemas;
|
|
|
|
// Exit if accessed directly
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
use EDD\Database\Schema;
|
|
|
|
/**
|
|
* Orders Schema Class.
|
|
*
|
|
* @since 3.0
|
|
*/
|
|
class Orders extends Schema {
|
|
|
|
/**
|
|
* Array of database column objects.
|
|
*
|
|
* @since 3.0
|
|
* @var array
|
|
*/
|
|
public $columns = array(
|
|
|
|
// id
|
|
array(
|
|
'name' => 'id',
|
|
'type' => 'bigint',
|
|
'length' => '20',
|
|
'unsigned' => true,
|
|
'extra' => 'auto_increment',
|
|
'primary' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// parent
|
|
array(
|
|
'name' => 'parent',
|
|
'type' => 'bigint',
|
|
'length' => '20',
|
|
'unsigned' => true,
|
|
'default' => '0',
|
|
'sortable' => true
|
|
),
|
|
|
|
// order_number
|
|
array(
|
|
'name' => 'order_number',
|
|
'type' => 'varchar',
|
|
'length' => '255',
|
|
'searchable' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// status
|
|
array(
|
|
'name' => 'status',
|
|
'type' => 'varchar',
|
|
'length' => '20',
|
|
'default' => 'pending',
|
|
'sortable' => true,
|
|
'transition' => true
|
|
),
|
|
|
|
// type
|
|
array(
|
|
'name' => 'type',
|
|
'type' => 'varchar',
|
|
'length' => '20',
|
|
'default' => 'sale',
|
|
'sortable' => true
|
|
),
|
|
|
|
// user_id
|
|
array(
|
|
'name' => 'user_id',
|
|
'type' => 'bigint',
|
|
'length' => '20',
|
|
'unsigned' => true,
|
|
'default' => '0',
|
|
'sortable' => true
|
|
),
|
|
|
|
// customer_id
|
|
array(
|
|
'name' => 'customer_id',
|
|
'type' => 'bigint',
|
|
'length' => '20',
|
|
'unsigned' => true,
|
|
'default' => '0',
|
|
'sortable' => true
|
|
),
|
|
|
|
// email
|
|
array(
|
|
'name' => 'email',
|
|
'type' => 'varchar',
|
|
'length' => '100',
|
|
'searchable' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// ip
|
|
array(
|
|
'name' => 'ip',
|
|
'type' => 'varchar',
|
|
'length' => '60',
|
|
'sortable' => true
|
|
),
|
|
|
|
// gateway
|
|
array(
|
|
'name' => 'gateway',
|
|
'type' => 'varchar',
|
|
'length' => '100',
|
|
'sortable' => true,
|
|
'default' => 'manual',
|
|
),
|
|
|
|
// mode
|
|
array(
|
|
'name' => 'mode',
|
|
'type' => 'varchar',
|
|
'length' => '20'
|
|
),
|
|
|
|
// currency
|
|
array(
|
|
'name' => 'currency',
|
|
'type' => 'varchar',
|
|
'length' => '20',
|
|
'validate' => 'strtoupper',
|
|
),
|
|
|
|
// payment_key
|
|
array(
|
|
'name' => 'payment_key',
|
|
'type' => 'varchar',
|
|
'length' => '64',
|
|
'searchable' => true,
|
|
),
|
|
|
|
// tax_rate_id
|
|
array(
|
|
'name' => 'tax_rate_id',
|
|
'type' => 'bigint',
|
|
'length' => '20',
|
|
'unsigned' => true,
|
|
'default' => null,
|
|
'allow_null' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// subtotal
|
|
array(
|
|
'name' => 'subtotal',
|
|
'type' => 'decimal',
|
|
'length' => '18,9',
|
|
'default' => '0',
|
|
'sortable' => true,
|
|
'validate' => 'edd_sanitize_amount'
|
|
),
|
|
|
|
// discount
|
|
array(
|
|
'name' => 'discount',
|
|
'type' => 'decimal',
|
|
'length' => '18,9',
|
|
'default' => '0',
|
|
'sortable' => true,
|
|
'validate' => 'edd_sanitize_amount'
|
|
),
|
|
|
|
// tax
|
|
array(
|
|
'name' => 'tax',
|
|
'type' => 'decimal',
|
|
'length' => '18,9',
|
|
'default' => '0',
|
|
'sortable' => true,
|
|
'validate' => 'edd_sanitize_amount'
|
|
),
|
|
|
|
// total
|
|
array(
|
|
'name' => 'total',
|
|
'type' => 'decimal',
|
|
'length' => '18,9',
|
|
'default' => '0',
|
|
'sortable' => true,
|
|
'validate' => 'edd_sanitize_amount'
|
|
),
|
|
|
|
// rate
|
|
array(
|
|
'name' => 'rate',
|
|
'type' => 'decimal',
|
|
'length' => '10,5',
|
|
'default' => '1.00000',
|
|
),
|
|
|
|
// date_created
|
|
array(
|
|
'name' => 'date_created',
|
|
'type' => 'datetime',
|
|
'default' => '', // Defaults to current time in query class
|
|
'created' => true,
|
|
'date_query' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// date_modified
|
|
array(
|
|
'name' => 'date_modified',
|
|
'type' => 'datetime',
|
|
'default' => '', // Defaults to current time in query class
|
|
'modified' => true,
|
|
'date_query' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// date_completed
|
|
array(
|
|
'name' => 'date_completed',
|
|
'type' => 'datetime',
|
|
'default' => null,
|
|
'allow_null' => true,
|
|
'date_query' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// date_refundable
|
|
array(
|
|
'name' => 'date_refundable',
|
|
'type' => 'datetime',
|
|
'default' => null,
|
|
'allow_null' => true,
|
|
'date_query' => true,
|
|
'sortable' => true
|
|
),
|
|
|
|
// uuid
|
|
array(
|
|
'uuid' => true,
|
|
)
|
|
);
|
|
}
|