Composable Commerce PHP SDKPHP SDK
  • Namespace
  • Class
  • Tree

Namespaces

  • Commercetools
    • Commons
      • Helper
    • Core
      • Builder
        • Request
        • Update
      • Cache
      • Client
        • Adapter
        • OAuth
      • Error
      • Helper
        • Annotate
        • State
          • Renderer
        • Subscriber
          • Log
      • Model
        • ApiClient
        • Cart
        • CartDiscount
        • Category
        • Channel
        • Common
        • Customer
        • CustomerGroup
        • CustomField
        • CustomObject
        • DiscountCode
        • Extension
        • Inventory
        • Message
        • Order
        • OrderEdit
        • Payment
        • Product
          • Search
        • ProductDiscount
        • ProductSelection
        • ProductType
        • Project
        • Review
        • ShippingMethod
        • ShoppingList
        • State
        • Store
        • Subscription
        • TaxCategory
        • Type
        • Zone
      • Request
        • ApiClients
        • CartDiscounts
          • Command
        • Carts
          • Command
        • Categories
          • Command
        • Channels
          • Command
        • CustomerGroups
          • Command
        • Customers
          • Command
        • CustomField
          • Command
        • CustomObjects
        • DiscountCodes
          • Command
        • Extensions
          • Command
        • GraphQL
        • InStores
        • Inventory
          • Command
        • Me
          • Command
        • Messages
        • OrderEdits
          • Command
          • StagedOrder
            • Command
        • Orders
          • Command
        • Payments
          • Command
        • ProductDiscounts
          • Command
        • Products
          • Command
        • ProductSelections
          • Command
        • ProductTypes
          • Command
        • Project
          • Command
        • Query
        • Reviews
          • Command
        • ShippingMethods
          • Command
        • ShoppingLists
          • Command
        • States
          • Command
        • Stores
          • Command
        • Subscriptions
          • Command
        • TaxCategories
          • Command
        • Types
          • Command
        • Zones
          • Command
      • Response

Classes

  • Cart
  • CartCollection
  • CartDiscountCodeState
  • CartDraft
  • CartReference
  • CartState
  • ClassificationShippingRateInput
  • ClassificationShippingRateInputDraft
  • CustomLineItem
  • CustomLineItemCollection
  • CustomLineItemDraft
  • CustomLineItemDraftCollection
  • DiscountCodeInfo
  • DiscountCodeInfoCollection
  • DiscountedLineItemPortion
  • DiscountedLineItemPortionCollection
  • DiscountedLineItemPrice
  • DiscountedPricePerQuantity
  • DiscountedPricePerQuantityCollection
  • ExternalLineItemTotalPrice
  • ExternalTaxAmountDraft
  • InventoryMode
  • ItemShippingDetails
  • ItemShippingDetailsDraft
  • ItemShippingTarget
  • ItemShippingTargetCollection
  • LineItem
  • LineItemCollection
  • LineItemDraft
  • LineItemDraftCollection
  • MyCartDraft
  • MyLineItemDraft
  • MyLineItemDraftCollection
  • ReplicaCartDraft
  • ScoreShippingRateInput
  • ScoreShippingRateInputDraft
  • ShippingInfo
  • ShippingRateInput
  • ShippingRateInputDraft

Class LineItemDraft

Commercetools\Core\Model\Common\AbstractJsonDeserializeObject implements Commercetools\Core\Model\Common\JsonDeserializeInterface, Commercetools\Core\Model\Common\ObjectTreeInterface uses Commercetools\Core\Model\Common\ObjectTreeTrait
Extended by Commercetools\Core\Model\Common\JsonObject implements JsonSerializable uses Commercetools\Core\Model\Common\ContextTrait
Extended by Commercetools\Core\Model\Cart\LineItemDraft
Namespace: Commercetools\Core\Model\Cart
API documentation: https://docs.commercetools.com/http-api-projects-carts.html#lineitemdraft
Located at Core/Model/Cart/LineItemDraft.php

Methods summary

public static Commercetools\Core\Model\Cart\LineItemDraft
# ofProductId( string $productId, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$productId
$context

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public static Commercetools\Core\Model\Cart\LineItemDraft
# ofProductIdVariantIdAndQuantity( string $productId, integer $variantId, integer $quantity, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$productId
$variantId
$quantity
$context

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public static Commercetools\Core\Model\Cart\LineItemDraft
# ofSku( string $sku, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$sku
$context

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public static Commercetools\Core\Model\Cart\LineItemDraft
# ofSkuAndQuantity( string $sku, integer $quantity, Commercetools\Core\Model\Common\Context|callable $context = null )

Parameters

$sku
$quantity
$context

Returns

Commercetools\Core\Model\Cart\LineItemDraft

Methods inherited from Commercetools\Core\Model\Common\JsonObject

__construct(), __get(), hasField(), isOptional()

Methods inherited from Commercetools\Core\Model\Common\AbstractJsonDeserializeObject

__sleep(), fromArray(), jsonSerialize(), of(), toArray()

Methods inherited from Commercetools\Core\Model\Common\ContextAwareInterface

getContext(), getContextCallback(), setContext(), setContextIfNull()

Methods inherited from Commercetools\Core\Model\Common\ObjectTreeInterface

parentSet(), rootGet(), rootSet()

Methods used from Commercetools\Core\Model\Common\ContextTrait

getContext(), getContextCallback(), setContext(), setContextIfNull()

Methods used from Commercetools\Core\Model\Common\ObjectTreeTrait

parentSet(), rootGet(), rootSet()

Magic methods summary

public string
# getProductId( )

Returns

string
public Commercetools\Core\Model\Cart\LineItemDraft
# setProductId( string $productId = null )

Parameters

$productId

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public integer
# getVariantId( )

Returns

integer
public Commercetools\Core\Model\Cart\LineItemDraft
# setVariantId( integer $variantId = null )

Parameters

$variantId

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public integer
# getQuantity( )

Returns

integer
public Commercetools\Core\Model\Cart\LineItemDraft
# setQuantity( integer $quantity = null )

Parameters

$quantity

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public Commercetools\Core\Model\Channel\ChannelReference
# getSupplyChannel( )

Returns

Commercetools\Core\Model\Channel\ChannelReference
public Commercetools\Core\Model\Cart\LineItemDraft
# setSupplyChannel( Commercetools\Core\Model\Channel\ChannelReference $supplyChannel = null )

Parameters

$supplyChannel

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public Commercetools\Core\Model\Channel\ChannelReference
# getDistributionChannel( )

Returns

Commercetools\Core\Model\Channel\ChannelReference
public Commercetools\Core\Model\Cart\LineItemDraft
# setDistributionChannel( Commercetools\Core\Model\Channel\ChannelReference $distributionChannel = null )

Parameters

$distributionChannel

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public Commercetools\Core\Model\CustomField\CustomFieldObject
# getCustom( )

Returns

Commercetools\Core\Model\CustomField\CustomFieldObject
public Commercetools\Core\Model\Cart\LineItemDraft
# setCustom( Commercetools\Core\Model\CustomField\CustomFieldObject $custom = null )

Parameters

$custom

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft
# getExternalTaxRate( )

Returns

Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft
public Commercetools\Core\Model\Cart\LineItemDraft
# setExternalTaxRate( Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft $externalTaxRate = null )

Parameters

$externalTaxRate

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public Commercetools\Core\Model\Common\Money
# getExternalPrice( )

Returns

Commercetools\Core\Model\Common\Money
public Commercetools\Core\Model\Cart\LineItemDraft
# setExternalPrice( Commercetools\Core\Model\Common\Money $externalPrice = null )

Parameters

$externalPrice

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public Commercetools\Core\Model\Cart\ExternalLineItemTotalPrice
# getExternalTotalPrice( )

Returns

Commercetools\Core\Model\Cart\ExternalLineItemTotalPrice
public Commercetools\Core\Model\Cart\LineItemDraft
# setExternalTotalPrice( Commercetools\Core\Model\Cart\ExternalLineItemTotalPrice $externalTotalPrice = null )

Parameters

$externalTotalPrice

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public string
# getSku( )

Returns

string
public Commercetools\Core\Model\Cart\LineItemDraft
# setSku( string $sku = null )

Parameters

$sku

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public Commercetools\Core\Model\Cart\ItemShippingDetailsDraft
# getShippingDetails( )

Returns

Commercetools\Core\Model\Cart\ItemShippingDetailsDraft
public Commercetools\Core\Model\Cart\LineItemDraft
# setShippingDetails( Commercetools\Core\Model\Cart\ItemShippingDetailsDraft $shippingDetails = null )

Parameters

$shippingDetails

Returns

Commercetools\Core\Model\Cart\LineItemDraft
public DateTime
# getAddedAt( )

Returns

DateTime
public Commercetools\Core\Model\Cart\LineItemDraft
# setAddedAt( DateTime $addedAt = null )

Parameters

$addedAt

Returns

Commercetools\Core\Model\Cart\LineItemDraft

Constants summary

Constants inherited from Commercetools\Core\Model\Common\JsonObject

DECORATOR, ELEMENT_TYPE, INITIALIZED, OPTIONAL, TYPE

Constants inherited from Commercetools\Core\Model\Common\AbstractJsonDeserializeObject

JSON_DESERIALIZE_INTERFACE, TYPEABLE_INTERFACE

PHP SDK API documentation generated by ApiGen