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 80 81
<?php
/**
* @author @jenschude <jens.schulze@commercetools.de>
*/
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\Customer\CustomerReference;
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-shoppingLists.html#shoppingListDraft
* @method string getKey()
* @method ShoppingListDraft setKey(string $key = null)
* @method LocalizedString getSlug()
* @method ShoppingListDraft setSlug(LocalizedString $slug = null)
* @method LocalizedString getName()
* @method ShoppingListDraft setName(LocalizedString $name = null)
* @method LocalizedString getDescription()
* @method ShoppingListDraft setDescription(LocalizedString $description = null)
* @method CustomerReference getCustomer()
* @method ShoppingListDraft setCustomer(CustomerReference $customer = null)
* @method LineItemDraftCollection getLineItems()
* @method ShoppingListDraft setLineItems(LineItemDraftCollection $lineItems = null)
* @method TextLineItemDraftCollection getTextLineItems()
* @method ShoppingListDraft setTextLineItems(TextLineItemDraftCollection $textLineItems = null)
* @method CustomFieldObjectDraft getCustom()
* @method ShoppingListDraft setCustom(CustomFieldObjectDraft $custom = null)
* @method int getDeleteDaysAfterLastModification()
* @method ShoppingListDraft setDeleteDaysAfterLastModification(int $deleteDaysAfterLastModification = null)
* @method string getAnonymousId()
* @method ShoppingListDraft setAnonymousId(string $anonymousId = null)
* @method StoreReference getStore()
* @method ShoppingListDraft setStore(StoreReference $store = null)
*/
class ShoppingListDraft extends Resource
{
public function fieldDefinitions()
{
return [
'key' => [static::TYPE => 'string', static::OPTIONAL => true],
'slug' => [static::TYPE => LocalizedString::class, static::OPTIONAL => true],
'name' => [static::TYPE => LocalizedString::class],
'description' => [static::TYPE => LocalizedString::class, static::OPTIONAL => true],
'customer' => [static::TYPE => CustomerReference::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],
'anonymousId' => [static::TYPE => 'string', static::OPTIONAL => true],
'store' => [static::TYPE => StoreReference::class, static::OPTIONAL => true],
];
}
/**
* @param LocalizedString $name
* @param Context|null $context
* @return ShoppingListDraft
*/
public static function ofName($name, $context = null)
{
return static::of($context)->setName($name);
}
/**
* @param LocalizedString $name
* @param string $key
* @param Context|null $context
* @return ShoppingListDraft
*/
public static function ofNameAndKey($name, $key, $context = null)
{
return static::of($context)->setName($name)->setKey($key);
}
}