Class Order
Class represents an order
- XLite\Model\AEntity
-
XLite\Model\Base\SurchargeOwner
-
XLite\Model\Order
Direct known subclasses
XLite\Model\CartSince: 1.0.0
See: ____class_see____
DiscriminatorColumn: (name="is_order", type="integer", length="1")
DiscriminatorMap: ({"1" = "XLite\Model\Order", "0" = "XLite\Model\Cart"})
Entity: (repositoryClass="\XLite\Model\Repo\Order")
HasLifecycleCallbacks
Index: (name="date", columns={"date"}),
Index: (name="total", columns={"total"}),
Index: (name="subtotal", columns={"subtotal"}),
Index: (name="tracking", columns={"tracking"}),
Index: (name="status", columns={"status"}),
Index: (name="shipping_id", columns={"shipping_id"}) } )
InheritanceType: ("SINGLE_TABLE")
Table: (name="orders", indexes={
Located at XLite/Model/Order.php
public static
array
|
|
public
boolean
|
|
public
string|
|
|
public
|
|
public
|
|
public
array
|
|
public
|
|
public
integer
|
|
public
integer
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
array
|
|
public
|
|
public
|
|
public
|
|
public
|
#
setOrigProfile( XLite\Model\Profile $profile = null )
Set original profile FIXME: is it really needed? |
public
|
|
public
string
|
|
public
string
|
|
public
array
|
|
public
mixed
|
|
public
|
|
public
array
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
array
|
|
public
|
|
public
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
|
#
checkPaymentTransactionStatusEqual( XLite\Model\Payment\Transaction $transaction, string $status )
Check payment transaction status |
public
boolean
|
#
isItemProductIdEqual( XLite\Model\OrderItem $item, integer $productId )
Check - is item product id equal specified product id |
public
boolean
|
#
checkLastPaymentMethod( XLite\Model\Payment\Method $pmethod, integer $lastPaymentId )
Check last payment method |
protected
|
|
public
|
#
setPaymentMethod(
Set payment method |
public
array
|
|
public
|
|
public
float
|
|
public
boolean
|
|
public
boolean
|
|
public
float
|
|
public
boolean
|
#
isPayed( )
Check - order is payed or not Payed - order has not open total and all payment transactions are failed or completed |
protected
|
|
protected
|
#
addPaymentTransaction( XLite\Model\Payment\Method $method, float $value = null )
Add payment transaction FIXME: move logic into \XLite\Model\Payment\Transaction |
protected
|
|
protected
|
|
public
|
|
public
|
|
public
boolean
|
|
public
array
|
|
public
array
|
|
public
array
|
|
public
|
|
public
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
public
array
|
|
public
float
|
#
getSurchargesSubtotal( string $type = null, boolean $include = null )
Get surcharges subtotal with specified type |
public
float
|
|
public
|
|
public
|
|
public
|
#
prepareEntityBeforeCommit( string $type )
Since Doctrine lifecycle callbacks do not allow to modify associations, we've added this method |
public
|
|
protected
boolean
|
|
protected
string|array
|
#
getStatusHandlers( string $old, string $new )
Return base part of the certain "change status" handler name |
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
integer
|
|
protected
|
|
protected
|
|
protected
|
__call(),
__get(),
__set(),
__unset(),
checkCache(),
cloneEntity(),
create(),
delete(),
detach(),
getMethodName(),
getRepository(),
getUniqueIdentifier(),
isPersistent(),
map(),
update()
|
string
|
STATUS_TEMPORARY |
'T' |
#
Order statuses |
string
|
STATUS_INPROGRESS |
'I' |
|
string
|
STATUS_QUEUED |
'Q' |
|
string
|
STATUS_PROCESSED |
'P' |
|
string
|
STATUS_COMPLETED |
'C' |
|
string
|
STATUS_FAILED |
'F' |
|
string
|
STATUS_DECLINED |
'D' |
|
float
|
ORDER_ZERO |
0.00001 |
#
Order total that is financially declared as zero (null) |
string
|
NOT_VALID_ERROR |
'notValid' |
#
Add item error codes |
ACTION_DELETE,
ACTION_INSERT,
ACTION_UPDATE
|
protected
mixed
|
$order_id | |
#
Order unique id |
protected
|
$profile | |
#
Order profile |
protected
|
$orig_profile | |
#
Original profile |
protected
integer
|
$shipping_id | 0 |
#
Shipping method unique id |
protected
integer
|
$shipping_method_name | '' |
#
Shipping method name |
protected
string
|
$tracking | '' |
#
Shipping tracking code |
protected
integer
|
$date | |
#
Order creation timestamp |
protected
integer
|
$lastRenewDate | 0 |
#
Last order renew date |
protected
string
|
$status | |
#
Status code |
protected
string
|
$notes | '' |
#
Customer notes |
protected
Doctrine\Common\Collections\Collection
|
$details | |
#
Order details |
protected
Doctrine\Common\Collections\Collection
|
$items | |
#
Order items |
protected
Doctrine\Common\Collections\Collection
|
$surcharges | |
#
Order surcharges |
protected
Doctrine\Common\Collections\Collection
|
$payment_transactions | |
#
Payment transactions |
protected
|
$currency | |
#
Currency |
protected
string
|
$addItemError | |
#
'Add item' error code |
protected static
array
|
$statusHandlers | array(
self::STATUS_TEMPORARY => array(
self::STATUS_PROCESSED => array('checkout', 'process'),
self::STATUS_COMPLETED => array('checkout', 'process'),
self::STATUS_QUEUED => array('checkout'),
self::STATUS_DECLINED => array('fail'),
self::STATUS_FAILED => array('fail'),
),
self::STATUS_INPROGRESS => array(
self::STATUS_PROCESSED => array('checkout', 'process'),
self::STATUS_COMPLETED => array('checkout', 'process'),
self::STATUS_QUEUED => array('checkout', 'queue'),
self::STATUS_DECLINED => array('fail'),
self::STATUS_FAILED => array('fail'),
),
self::STATUS_QUEUED => array(
self::STATUS_TEMPORARY => array('uncheckout'),
self::STATUS_INPROGRESS => array('uncheckout'),
self::STATUS_PROCESSED => array('process'),
self::STATUS_COMPLETED => array('process'),
self::STATUS_DECLINED => array('uncheckout', 'fail'),
self::STATUS_FAILED => array('uncheckout', 'fail'),
),
self::STATUS_PROCESSED => array(
self::STATUS_TEMPORARY => array('decline', 'uncheckout'),
self::STATUS_INPROGRESS => array('decline', 'uncheckout'),
self::STATUS_QUEUED => array('decline'),
self::STATUS_DECLINED => array('decline', 'uncheckout', 'fail'),
self::STATUS_FAILED => array('decline', 'uncheckout', 'fail'),
),
self::STATUS_COMPLETED => array(
self::STATUS_TEMPORARY => array('decline', 'uncheckout'),
self::STATUS_INPROGRESS => array('decline', 'uncheckout'),
self::STATUS_QUEUED => array('decline'),
self::STATUS_DECLINED => array('decline', 'uncheckout', 'fail'),
self::STATUS_FAILED => array('decline', 'uncheckout', 'fail'),
),
self::STATUS_DECLINED => array(
self::STATUS_PROCESSED => array('checkout', 'process'),
self::STATUS_COMPLETED => array('checkout', 'process'),
self::STATUS_QUEUED => array('checkout'),
),
self::STATUS_FAILED => array(
self::STATUS_PROCESSED => array('checkout', 'process'),
self::STATUS_COMPLETED => array('checkout', 'process'),
self::STATUS_QUEUED => array('checkout'),
),
) |
#
List of change status handlers; top index - old status, second index - new one (<old_status> ----> <new_status>: $statusHandlers[$old][$new]) |
protected
string
|
$oldStatus | |
#
Order previous status |
protected
|
$modifiers | |
#
Modifiers (cache) |
$subtotal,
$total
|
$cacheEnabled,
$methodNames
|