1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jayS-de <[email protected]> |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Model\Cart; |
7
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\JsonObject; |
9
|
|
|
use Commercetools\Core\Model\Common\LocalizedString; |
10
|
|
|
use Commercetools\Core\Model\Common\Money; |
11
|
|
|
use Commercetools\Core\Model\Order\ItemState; |
12
|
|
|
use Commercetools\Core\Model\TaxCategory\TaxCategoryReference; |
13
|
|
|
use Commercetools\Core\Model\TaxCategory\TaxRate; |
14
|
|
|
use Commercetools\Core\Model\CustomField\CustomFieldObject; |
15
|
|
|
use Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @package Commercetools\Core\Model\Cart |
19
|
|
|
* @link https://dev.commercetools.com/http-api-projects-carts.html#custom-line-item-draft |
20
|
|
|
* @method LocalizedString getName() |
21
|
|
|
* @method CustomLineItemDraft setName(LocalizedString $name = null) |
22
|
|
|
* @method Money getMoney() |
23
|
|
|
* @method CustomLineItemDraft setMoney(Money $money = null) |
24
|
|
|
* @method string getSlug() |
25
|
|
|
* @method CustomLineItemDraft setSlug(string $slug = null) |
26
|
|
|
* @method int getQuantity() |
27
|
|
|
* @method CustomLineItemDraft setQuantity(int $quantity = null) |
28
|
|
|
* @method TaxCategoryReference getTaxCategory() |
29
|
|
|
* @method CustomLineItemDraft setTaxCategory(TaxCategoryReference $taxCategory = null) |
30
|
|
|
* @method CustomFieldObject getCustom() |
31
|
|
|
* @method CustomLineItemDraft setCustom(CustomFieldObject $custom = null) |
32
|
|
|
* @method ExternalTaxRateDraft getExternalTaxRate() |
33
|
|
|
* @method CustomLineItemDraft setExternalTaxRate(ExternalTaxRateDraft $externalTaxRate = null) |
34
|
|
|
*/ |
35
|
|
View Code Duplication |
class CustomLineItemDraft extends JsonObject |
|
|
|
|
36
|
|
|
{ |
37
|
1 |
|
public function fieldDefinitions() |
38
|
|
|
{ |
39
|
|
|
return [ |
40
|
1 |
|
'name' => [static::TYPE => '\Commercetools\Core\Model\Common\LocalizedString'], |
41
|
1 |
|
'money' => [static::TYPE => '\Commercetools\Core\Model\Common\Money'], |
42
|
1 |
|
'slug' => [static::TYPE => 'string'], |
43
|
1 |
|
'quantity' => [static::TYPE => 'int'], |
44
|
1 |
|
'taxCategory' => [static::TYPE => '\Commercetools\Core\Model\TaxCategory\TaxCategoryReference'], |
45
|
1 |
|
'externalTaxRate' => [static::TYPE => '\Commercetools\Core\Model\TaxCategory\ExternalTaxRateDraft'], |
46
|
1 |
|
'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'], |
47
|
|
|
]; |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.