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
<?php
/**
* @author @jenschude <jens.schulze@commercetools.de>
*/
namespace Commercetools\Core\Model\Cart;
use Commercetools\Core\Model\Common\JsonObject;
use Commercetools\Core\Model\Common\LocalizedString;
use Commercetools\Core\Model\Common\Money;
use Commercetools\Core\Model\Order\ItemState;
use Commercetools\Core\Model\TaxCategory\TaxCategoryReference;
use Commercetools\Core\Model\TaxCategory\TaxRate;
use Commercetools\Core\Model\CustomField\CustomFieldObject;
use Commercetools\Core\Model\Common\TaxedItemPrice;
/**
* @package Commercetools\Core\Model\Cart
* @link https://docs.commercetools.com/http-api-projects-carts.html#customlineitem
* @method string getId()
* @method CustomLineItem setId(string $id = null)
* @method LocalizedString getName()
* @method CustomLineItem setName(LocalizedString $name = null)
* @method Money getMoney()
* @method CustomLineItem setMoney(Money $money = null)
* @method string getSlug()
* @method CustomLineItem setSlug(string $slug = null)
* @method int getQuantity()
* @method CustomLineItem setQuantity(int $quantity = null)
* @method ItemState getState()
* @method CustomLineItem setState(ItemState $state = null)
* @method TaxCategoryReference getTaxCategory()
* @method CustomLineItem setTaxCategory(TaxCategoryReference $taxCategory = null)
* @method TaxRate getTaxRate()
* @method CustomLineItem setTaxRate(TaxRate $taxRate = null)
* @method CustomFieldObject getCustom()
* @method CustomLineItem setCustom(CustomFieldObject $custom = null)
* @method Money getTotalPrice()
* @method CustomLineItem setTotalPrice(Money $totalPrice = null)
* @method DiscountedPricePerQuantityCollection getDiscountedPricePerQuantity()
* @method TaxedItemPrice getTaxedPrice()
* @method CustomLineItem setTaxedPrice(TaxedItemPrice $taxedPrice = null)
* @method ItemShippingDetails getShippingDetails()
* @method CustomLineItem setShippingDetails(ItemShippingDetails $shippingDetails = null)
*/
class CustomLineItem extends JsonObject
{
public function fieldDefinitions()
{
return [
'id' => [static::TYPE => 'string'],
'name' => [static::TYPE => LocalizedString::class],
'money' => [static::TYPE => Money::class],
'taxedPrice' => [static::TYPE => TaxedItemPrice::class, static::OPTIONAL => true],
'slug' => [static::TYPE => 'string'],
'quantity' => [static::TYPE => 'int'],
'state' => [static::TYPE => ItemState::class],
'taxCategory' => [static::TYPE => TaxCategoryReference::class, static::OPTIONAL => true],
'taxRate' => [static::TYPE => TaxRate::class, static::OPTIONAL => true],
'custom' => [static::TYPE => CustomFieldObject::class, static::OPTIONAL => true],
'totalPrice' => [static::TYPE => Money::class],
'discountedPricePerQuantity' => [
static::TYPE => DiscountedPricePerQuantityCollection::class
],
'shippingDetails' => [static::TYPE => ItemShippingDetails::class, static::OPTIONAL => true],
];
}
/**
* @param DiscountedPricePerQuantityCollection $discountedPricePerQuantity
* @return static
*/
public function setDiscountedPricePerQuantity(
DiscountedPricePerQuantityCollection $discountedPricePerQuantity = null
) {
return parent::setDiscountedPricePerQuantity($discountedPricePerQuantity);
}
}