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
<?php
/**
*/
namespace Commercetools\Core\Model\Store;
use Commercetools\Core\Model\Channel\ChannelReference;
use Commercetools\Core\Model\Common\Context;
use Commercetools\Core\Model\Common\JsonObject;
use Commercetools\Core\Model\Common\LocalizedString;
use Commercetools\Core\Model\CustomField\CustomFieldObject;
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraft;
/**
* @package Commercetools\Core\Model\Store
* @link https://docs.commercetools.com/http-api-projects-stores#storedraft
*
*
*
* @method string getKey()
* @method StoreDraft setKey(string $key = null)
* @method LocalizedString getName()
* @method StoreDraft setName(LocalizedString $name = null)
* @method array getLanguages()
* @method StoreDraft setLanguages(array $languages = null)
* @method StoreDraft setDistributionChannel(ChannelReference $distributionChannel = null)
* @method StoreDraft setSupplyChannel(ChannelReference $supplyChannel = null)
* @method array getDistributionChannels()
* @method StoreDraft setDistributionChannels(array $distributionChannels = null)
* @method array getSupplyChannels()
* @method StoreDraft setSupplyChannels(array $supplyChannels = null)
* @method CustomFieldObjectDraft getCustom()
* @method StoreDraft setCustom(CustomFieldObjectDraft $custom = null)
* @method array getProductSelections()
* @method StoreDraft setProductSelections(array $productSelections = null)
*/
class StoreDraft extends JsonObject
{
public function fieldDefinitions()
{
return [
'key' => [static::TYPE => 'string'],
'name' => [static::TYPE => LocalizedString::class, static::OPTIONAL => true],
'languages' => [static::TYPE => 'array', static::OPTIONAL => true],
'distributionChannels' => [static::TYPE => 'array', static::OPTIONAL => true],
'supplyChannels' => [static::TYPE => 'array', static::OPTIONAL => true],
'productSelections' => [static::TYPE => 'array', static::OPTIONAL => true],
'custom' => [static::TYPE => CustomFieldObjectDraft::class, static::OPTIONAL => true],
];
}
/**
* @param string $key
* @param Context|callable $context
* @return StoreDraft
*/
public static function ofKey($key, Context $context)
{
return static::of($context)->setKey($key);
}
/**
* @param string $key
* @param LocalizedString $name
* @param Context|null $context
* @return StoreDraft
*/
public static function ofKeyAndName($key, LocalizedString $name, $context = null)
{
return static::of($context)->setKey($key)->setName($name);
}
}