commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
Public Member Functions | Public Attributes | List of all members
Commercetools\Api\Models\CartDiscount\CartDiscountDraft Interface Reference
Inheritance diagram for Commercetools\Api\Models\CartDiscount\CartDiscountDraft:
Commercetools\Base\JsonObject Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel

Public Member Functions

 getName ()
 
 getKey ()
 
 getDescription ()
 
 getValue ()
 
 getCartPredicate ()
 
 getTarget ()
 
 getSortOrder ()
 
 getStores ()
 
 getIsActive ()
 
 getValidFrom ()
 
 getValidUntil ()
 
 getRequiresDiscountCode ()
 
 getStackingMode ()
 
 getCustom ()
 
 setName (?LocalizedString $name)
 
 setKey (?string $key)
 
 setDescription (?LocalizedString $description)
 
 setValue (?CartDiscountValueDraft $value)
 
 setCartPredicate (?string $cartPredicate)
 
 setTarget (?CartDiscountTarget $target)
 
 setSortOrder (?string $sortOrder)
 
 setStores (?StoreResourceIdentifierCollection $stores)
 
 setIsActive (?bool $isActive)
 
 setValidFrom (?DateTimeImmutable $validFrom)
 
 setValidUntil (?DateTimeImmutable $validUntil)
 
 setRequiresDiscountCode (?bool $requiresDiscountCode)
 
 setStackingMode (?string $stackingMode)
 
 setCustom (?CustomFieldsDraft $custom)
 
- Public Member Functions inherited from Commercetools\Base\JsonObject
 get (string $field)
 
 with (callable $callable=null)
 

Public Attributes

const FIELD_NAME = 'name'
 
const FIELD_KEY = 'key'
 
const FIELD_DESCRIPTION = 'description'
 
const FIELD_VALUE = 'value'
 
const FIELD_CART_PREDICATE = 'cartPredicate'
 
const FIELD_TARGET = 'target'
 
const FIELD_SORT_ORDER = 'sortOrder'
 
const FIELD_STORES = 'stores'
 
const FIELD_IS_ACTIVE = 'isActive'
 
const FIELD_VALID_FROM = 'validFrom'
 
const FIELD_VALID_UNTIL = 'validUntil'
 
const FIELD_REQUIRES_DISCOUNT_CODE = 'requiresDiscountCode'
 
const FIELD_STACKING_MODE = 'stackingMode'
 
const FIELD_CUSTOM = 'custom'
 

Additional Inherited Members

- Static Public Member Functions inherited from Commercetools\Base\JsonObject
static of ($data=null)
 
static fromArray (array $data=[])
 
static fromStdClass (stdClass $data=null)
 

Detailed Description

Definition at line 18 of file CartDiscountDraft.php.

Member Function Documentation

◆ getCartPredicate()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getCartPredicate ( )

◆ getCustom()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getCustom ( )

Custom Fields of the CartDiscount.

Returns
null|CustomFieldsDraft

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getDescription()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getDescription ( )

Description of the CartDiscount.

Returns
null|LocalizedString

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getIsActive()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getIsActive ( )

Only active Discounts can be applied to the Cart. If the limit for active Cart Discounts is reached, a MaxCartDiscountsReached error is returned.

Returns
null|bool

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getKey()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getKey ( )

User-defined unique identifier for the CartDiscount.

Returns
null|string

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getName()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getName ( )

Name of the CartDiscount.

Returns
null|LocalizedString

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getRequiresDiscountCode()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getRequiresDiscountCode ( )

States whether the Discount can only be used in a connection with a DiscountCode.

Returns
null|bool

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getSortOrder()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getSortOrder ( )

Value between 0 and 1. A Discount with a higher sortOrder is prioritized. The sort order must be unambiguous among all CartDiscounts.

Returns
null|string

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getStackingMode()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getStackingMode ( )

Specifies whether the application of this discount causes the following discounts to be ignored.

Returns
null|string

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getStores()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getStores ( )
  • If defined, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
  • If not defined, the Cart Discount applies on all Carts, irrespective of a Store.

If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.

If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.

Returns
null|StoreResourceIdentifierCollection

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getTarget()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getTarget ( )

Segment of the Cart that will be discounted.

Must not be set if the value is giftLineItem.

Returns
null|CartDiscountTarget

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getValidFrom()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getValidFrom ( )

Date and time (UTC) from which the Discount is effective.

Returns
null|DateTimeImmutable

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getValidUntil()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getValidUntil ( )

Date and time (UTC) until which the Discount is effective.

Returns
null|DateTimeImmutable

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ getValue()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::getValue ( )

Effect of the CartDiscount on the target.

Returns
null|CartDiscountValueDraft

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setCartPredicate()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setCartPredicate ( ?string  $cartPredicate)
Parameters
?string$cartPredicate

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setCustom()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setCustom ( ?CustomFieldsDraft  $custom)
Parameters
?CustomFieldsDraft$custom

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setDescription()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setDescription ( ?LocalizedString  $description)
Parameters
?LocalizedString$description

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setIsActive()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setIsActive ( ?bool  $isActive)
Parameters
?bool$isActive

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setKey()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setKey ( ?string  $key)
Parameters
?string$key

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setName()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setName ( ?LocalizedString  $name)
Parameters
?LocalizedString$name

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setRequiresDiscountCode()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setRequiresDiscountCode ( ?bool  $requiresDiscountCode)
Parameters
?bool$requiresDiscountCode

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setSortOrder()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setSortOrder ( ?string  $sortOrder)
Parameters
?string$sortOrder

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setStackingMode()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setStackingMode ( ?string  $stackingMode)
Parameters
?string$stackingMode

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setStores()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setStores ( ?StoreResourceIdentifierCollection  $stores)
Parameters
?StoreResourceIdentifierCollection$stores

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setTarget()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setTarget ( ?CartDiscountTarget  $target)
Parameters
?CartDiscountTarget$target

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setValidFrom()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setValidFrom ( ?DateTimeImmutable  $validFrom)
Parameters
?DateTimeImmutable$validFrom

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setValidUntil()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setValidUntil ( ?DateTimeImmutable  $validUntil)
Parameters
?DateTimeImmutable$validUntil

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

◆ setValue()

Commercetools\Api\Models\CartDiscount\CartDiscountDraft::setValue ( ?CartDiscountValueDraft  $value)
Parameters
?CartDiscountValueDraft$value

Implemented in Commercetools\Api\Models\CartDiscount\CartDiscountDraftModel.

Member Data Documentation

◆ FIELD_CART_PREDICATE

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_CART_PREDICATE = 'cartPredicate'

Definition at line 24 of file CartDiscountDraft.php.

◆ FIELD_CUSTOM

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_CUSTOM = 'custom'

Definition at line 33 of file CartDiscountDraft.php.

◆ FIELD_DESCRIPTION

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_DESCRIPTION = 'description'

Definition at line 22 of file CartDiscountDraft.php.

◆ FIELD_IS_ACTIVE

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_IS_ACTIVE = 'isActive'

Definition at line 28 of file CartDiscountDraft.php.

◆ FIELD_KEY

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_KEY = 'key'

Definition at line 21 of file CartDiscountDraft.php.

◆ FIELD_NAME

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_NAME = 'name'

Definition at line 20 of file CartDiscountDraft.php.

◆ FIELD_REQUIRES_DISCOUNT_CODE

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_REQUIRES_DISCOUNT_CODE = 'requiresDiscountCode'

Definition at line 31 of file CartDiscountDraft.php.

◆ FIELD_SORT_ORDER

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_SORT_ORDER = 'sortOrder'

Definition at line 26 of file CartDiscountDraft.php.

◆ FIELD_STACKING_MODE

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_STACKING_MODE = 'stackingMode'

Definition at line 32 of file CartDiscountDraft.php.

◆ FIELD_STORES

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_STORES = 'stores'

Definition at line 27 of file CartDiscountDraft.php.

◆ FIELD_TARGET

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_TARGET = 'target'

Definition at line 25 of file CartDiscountDraft.php.

◆ FIELD_VALID_FROM

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_VALID_FROM = 'validFrom'

Definition at line 29 of file CartDiscountDraft.php.

◆ FIELD_VALID_UNTIL

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_VALID_UNTIL = 'validUntil'

Definition at line 30 of file CartDiscountDraft.php.

◆ FIELD_VALUE

const Commercetools\Api\Models\CartDiscount\CartDiscountDraft::FIELD_VALUE = 'value'

Definition at line 23 of file CartDiscountDraft.php.


The documentation for this interface was generated from the following file: