1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
<?php
/**
* @author @jenschude <jens.schulze@commercetools.de>
*/
namespace Commercetools\Core\Model\Order;
use Commercetools\Core\Model\Cart\CustomLineItemCollection;
use Commercetools\Core\Model\Cart\LineItemCollection;
use Commercetools\Core\Model\Cart\ShippingInfo;
use Commercetools\Core\Model\Cart\ShippingRateInput;
use Commercetools\Core\Model\CartDiscount\CartDiscountReferenceCollection;
use Commercetools\Core\Model\Common\Address;
use Commercetools\Core\Model\Common\AddressCollection;
use Commercetools\Core\Model\Common\CreatedBy;
use Commercetools\Core\Model\Common\LastModifiedBy;
use Commercetools\Core\Model\Common\LocaleTrait;
use Commercetools\Core\Model\Common\Resource;
use Commercetools\Core\Model\Common\Money;
use Commercetools\Core\Model\Common\TaxedPrice;
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;
use Commercetools\Core\Model\Cart\DiscountCodeInfoCollection;
use Commercetools\Core\Model\Cart\CartReference;
use Commercetools\Core\Model\CustomField\CustomFieldObject;
use Commercetools\Core\Model\Common\DateTimeDecorator;
use Commercetools\Core\Model\State\StateReference;
use Commercetools\Core\Model\Payment\PaymentInfo;
use Commercetools\Core\Model\Store\StoreReference;
use DateTime;
/**
* @package Commercetools\Core\Model\Order
* @link https://docs.commercetools.com/http-api-projects-orders.html#order
* @method string getId()
* @method Order setId(string $id = null)
* @method int getVersion()
* @method Order setVersion(int $version = null)
* @method DateTimeDecorator getCreatedAt()
* @method Order setCreatedAt(DateTime $createdAt = null)
* @method DateTimeDecorator getLastModifiedAt()
* @method Order setLastModifiedAt(DateTime $lastModifiedAt = null)
* @method string getOrderNumber()
* @method Order setOrderNumber(string $orderNumber = null)
* @method string getCustomerId()
* @method Order setCustomerId(string $customerId = null)
* @method string getCustomerEmail()
* @method Order setCustomerEmail(string $customerEmail = null)
* @method LineItemCollection getLineItems()
* @method Order setLineItems(LineItemCollection $lineItems = null)
* @method CustomLineItemCollection getCustomLineItems()
* @method Order setCustomLineItems(CustomLineItemCollection $customLineItems = null)
* @method Money getTotalPrice()
* @method Order setTotalPrice(Money $totalPrice = null)
* @method TaxedPrice getTaxedPrice()
* @method Order setTaxedPrice(TaxedPrice $taxedPrice = null)
* @method Address getShippingAddress()
* @method Order setShippingAddress(Address $shippingAddress = null)
* @method Address getBillingAddress()
* @method Order setBillingAddress(Address $billingAddress = null)
* @method string getInventoryMode()
* @method Order setInventoryMode(string $inventoryMode = null)
* @method CustomerGroupReference getCustomerGroup()
* @method Order setCustomerGroup(CustomerGroupReference $customerGroup = null)
* @method string getCountry()
* @method Order setCountry(string $country = null)
* @method string getOrderState()
* @method Order setOrderState(string $orderState = null)
* @method string getShipmentState()
* @method Order setShipmentState(string $shipmentState = null)
* @method string getPaymentState()
* @method Order setPaymentState(string $paymentState = null)
* @method ShippingInfo getShippingInfo()
* @method Order setShippingInfo(ShippingInfo $shippingInfo = null)
* @method SyncInfoCollection getSyncInfo()
* @method Order setSyncInfo(SyncInfoCollection $syncInfo = null)
* @method ReturnInfoCollection getReturnInfo()
* @method Order setReturnInfo(ReturnInfoCollection $returnInfo = null)
* @method DiscountCodeInfoCollection getDiscountCodes()
* @method Order setDiscountCodes(DiscountCodeInfoCollection $discountCodes = null)
* @method int getLastMessageSequenceNumber()
* @method Order setLastMessageSequenceNumber(int $lastMessageSequenceNumber = null)
* @method CartReference getCart()
* @method Order setCart(CartReference $cart = null)
* @method CustomFieldObject getCustom()
* @method Order setCustom(CustomFieldObject $custom = null)
* @method StateReference getState()
* @method Order setState(StateReference $state = null)
* @method PaymentInfo getPaymentInfo()
* @method Order setPaymentInfo(PaymentInfo $paymentInfo = null)
* @method DateTimeDecorator getCompletedAt()
* @method Order setCompletedAt(DateTime $completedAt = null)
* @method string getAnonymousId()
* @method Order setAnonymousId(string $anonymousId = null)
* @method string getLocale()
* @method string getTaxRoundingMode()
* @method Order setTaxRoundingMode(string $taxRoundingMode = null)
* @method string getOrigin()
* @method Order setOrigin(string $origin = null)
* @method string getTaxCalculationMode()
* @method Order setTaxCalculationMode(string $taxCalculationMode = null)
* @method string getTaxMode()
* @method Order setTaxMode(string $taxMode = null)
* @method ShippingRateInput getShippingRateInput()
* @method Order setShippingRateInput(ShippingRateInput $shippingRateInput = null)
* @method AddressCollection getItemShippingAddresses()
* @method Order setItemShippingAddresses(AddressCollection $itemShippingAddresses = null)
* @method StoreReference getStore()
* @method Order setStore(StoreReference $store = null)
* @method CreatedBy getCreatedBy()
* @method Order setCreatedBy(CreatedBy $createdBy = null)
* @method LastModifiedBy getLastModifiedBy()
* @method Order setLastModifiedBy(LastModifiedBy $lastModifiedBy = null)
* @method CartDiscountReferenceCollection getRefusedGifts()
* @method Order setRefusedGifts(CartDiscountReferenceCollection $refusedGifts = null)
* @method OrderReference getReference()
*/
class Order extends Resource
{
const TAX_MODE_PLATFORM = 'Platform';
const TAX_MODE_EXTERNAL = 'External';
const TAX_MODE_DISABLED = 'Disabled';
const TAX_ROUNDING_MODE_HALF_EVEN = 'HalfEven';
const TAX_ROUNDING_MODE_HALF_UP = 'HalfUp';
const TAX_ROUNDING_MODE_HALF_DOWN = 'HalfDown';
use LocaleTrait;
public function fieldDefinitions()
{
return [
'id' => [static::TYPE => 'string'],
'version' => [static::TYPE => 'int'],
'createdAt' => [
static::TYPE => DateTime::class,
static::DECORATOR => DateTimeDecorator::class
],
'lastModifiedAt' => [
static::TYPE => DateTime::class,
static::DECORATOR => DateTimeDecorator::class
],
'completedAt' => [
static::TYPE => DateTime::class,
static::OPTIONAL => true,
static::DECORATOR => DateTimeDecorator::class
],
'orderNumber' => [static::TYPE => 'string', static::OPTIONAL => true],
'customerId' => [static::TYPE => 'string', static::OPTIONAL => true],
'customerEmail' => [static::TYPE => 'string', static::OPTIONAL => true],
'lineItems' => [static::TYPE => LineItemCollection::class],
'customLineItems' => [static::TYPE => CustomLineItemCollection::class],
'totalPrice' => [static::TYPE => Money::class],
'taxedPrice' => [static::TYPE => TaxedPrice::class, static::OPTIONAL => true],
'shippingAddress' => [static::TYPE => Address::class, static::OPTIONAL => true],
'billingAddress' => [static::TYPE => Address::class, static::OPTIONAL => true],
'inventoryMode' => [static::TYPE => 'string', static::OPTIONAL => true],
'customerGroup' => [static::TYPE => CustomerGroupReference::class, static::OPTIONAL => true],
'country' => [static::TYPE => 'string', static::OPTIONAL => true],
'orderState' => [static::TYPE => 'string'],
'shipmentState' => [static::TYPE => 'string', static::OPTIONAL => true],
'paymentState' => [static::TYPE => 'string', static::OPTIONAL => true],
'shippingInfo' => [static::TYPE => ShippingInfo::class, static::OPTIONAL => true],
'syncInfo' => [static::TYPE => SyncInfoCollection::class],
'returnInfo' => [static::TYPE => ReturnInfoCollection::class, static::OPTIONAL => true],
'discountCodes' => [static::TYPE => DiscountCodeInfoCollection::class, static::OPTIONAL => true],
'lastMessageSequenceNumber' => [static::TYPE => 'int', static::OPTIONAL => true],
'cart' => [static::TYPE => CartReference::class, static::OPTIONAL => true],
'custom' => [static::TYPE => CustomFieldObject::class, static::OPTIONAL => true],
'state' => [static::TYPE => StateReference::class, static::OPTIONAL => true],
'paymentInfo' => [static::TYPE => PaymentInfo::class, static::OPTIONAL => true],
'anonymousId' => [static::TYPE => 'string', static::OPTIONAL => true],
'locale' => [static::TYPE => 'string', static::OPTIONAL => true],
'taxRoundingMode' => [static::TYPE => 'string', static::OPTIONAL => true],
'origin' => [static::TYPE => 'string'],
'taxCalculationMode' => [static::TYPE => 'string', static::OPTIONAL => true],
'taxMode' => [static::TYPE => 'string', static::OPTIONAL => true],
'shippingRateInput' => [static::TYPE => ShippingRateInput::class, static::OPTIONAL => true],
'itemShippingAddresses' => [static::TYPE => AddressCollection::class, static::OPTIONAL => true],
'store' => [static::TYPE => StoreReference::class, static::OPTIONAL => true],
'createdBy' => [static::TYPE => CreatedBy::class, static::OPTIONAL => true],
'lastModifiedBy' => [static::TYPE => LastModifiedBy::class, static::OPTIONAL => true],
'refusedGifts' => [static::TYPE => CartDiscountReferenceCollection::class],
];
}
}