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
<?php
/**
*/
namespace Commercetools\Core\Model\ShoppingList;
use Commercetools\Core\Model\Common\Context;
use Commercetools\Core\Model\Common\Resource;
use Commercetools\Core\Model\Common\LocalizedString;
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;
use Commercetools\Core\Model\Store\StoreReference;
/**
* @package Commercetools\Core\Model\ShoppingList
* @link https://docs.commercetools.com/http-api-projects-me-shoppingLists#myshoppinglistdraft
* @method LocalizedString getName()
* @method MyShoppingListDraft setName(LocalizedString $name = null)
* @method LocalizedString getDescription()
* @method MyShoppingListDraft setDescription(LocalizedString $description = null)
* @method LineItemDraftCollection getLineItems()
* @method MyShoppingListDraft setLineItems(LineItemDraftCollection $lineItems = null)
* @method TextLineItemDraftCollection getTextLineItems()
* @method MyShoppingListDraft setTextLineItems(TextLineItemDraftCollection $textLineItems = null)
* @method CustomFieldObjectDraft getCustom()
* @method MyShoppingListDraft setCustom(CustomFieldObjectDraft $custom = null)
* @method int getDeleteDaysAfterLastModification()
* @method MyShoppingListDraft setDeleteDaysAfterLastModification(int $deleteDaysAfterLastModification = null)
* @method StoreReference getStore()
* @method MyShoppingListDraft setStore(StoreReference $store = null)
*/
class MyShoppingListDraft extends Resource
{
public function fieldDefinitions()
{
return [
'name' => [static::TYPE => LocalizedString::class],
'description' => [static::TYPE => LocalizedString::class, static::OPTIONAL => true],
'lineItems' => [static::TYPE => LineItemDraftCollection::class, static::OPTIONAL => true],
'textLineItems' => [static::TYPE => TextLineItemDraftCollection::class, static::OPTIONAL => true],
'custom' => [static::TYPE => CustomFieldObjectDraft::class, static::OPTIONAL => true],
'deleteDaysAfterLastModification' => [static::TYPE => 'int', static::OPTIONAL => true],
'store' => [static::TYPE => StoreReference::class, static::OPTIONAL => true],
];
}
/**
* @param LocalizedString $name
* @param Context|null $context
* @return MyShoppingListDraft
*/
public static function ofName(LocalizedString $name, $context = null)
{
return static::of($context)->setName($name);
}
}