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
<?php
/**
* @author @jenschude <jens.schulze@commercetools.de>
*/
namespace Commercetools\Core\Model\Product;
use Commercetools\Core\Model\Common\AttributeCollection;
use Commercetools\Core\Model\Common\ImageCollection;
use Commercetools\Core\Model\Common\JsonObject;
use Commercetools\Core\Model\Common\PriceCollection;
use Commercetools\Core\Model\Common\Price;
use Commercetools\Core\Model\Common\ScopedPrice;
use Commercetools\Core\Model\Common\AssetCollection;
/**
* @package Commercetools\Core\Model\Product
* @link https://docs.commercetools.com/http-api-projects-products.html#productvariant
* @method int getId()
* @method ProductVariant setId(int $id = null)
* @method string getSku()
* @method ProductVariant setSku(string $sku = null)
* @method PriceCollection getPrices()
* @method ProductVariant setPrices(PriceCollection $prices = null)
* @method AttributeCollection getAttributes()
* @method ProductVariant setAttributes(AttributeCollection $attributes = null)
* @method ImageCollection getImages()
* @method ProductVariant setImages(ImageCollection $images = null)
* @method ProductVariantAvailability getAvailability()
* @method ProductVariant setAvailability(ProductVariantAvailability $availability = null)
* @method Price getPrice()
* @method ProductVariant setPrice(Price $price = null)
* @method bool getIsMatchingVariant()
* @method ProductVariant setIsMatchingVariant(bool $isMatchingVariant = null)
* @method ScopedPrice getScopedPrice()
* @method ProductVariant setScopedPrice(ScopedPrice $scopedPrice = null)
* @method bool getScopedPriceDiscounted()
* @method ProductVariant setScopedPriceDiscounted(bool $scopedPriceDiscounted = null)
* @method AssetCollection getAssets()
* @method ProductVariant setAssets(AssetCollection $assets = null)
* @method string getKey()
* @method ProductVariant setKey(string $key = null)
*/
class ProductVariant extends JsonObject
{
public function fieldDefinitions()
{
return [
'id' => [static::TYPE => 'int'],
'sku' => [static::TYPE => 'string', static::OPTIONAL => true],
'prices' => [static::TYPE => PriceCollection::class, static::OPTIONAL => true],
'price' => [static::TYPE => Price::class, static::OPTIONAL => true],
'attributes' => [static::TYPE => AttributeCollection::class, static::OPTIONAL => true],
'images' => [static::TYPE => ImageCollection::class, static::OPTIONAL => true],
'availability' => [static::TYPE => ProductVariantAvailability::class, static::OPTIONAL => true],
'isMatchingVariant' => [static::TYPE => 'bool', static::OPTIONAL => true],
'scopedPrice' => [static::TYPE => ScopedPrice::class, static::OPTIONAL => true],
'scopedPriceDiscounted' => [static::TYPE => 'bool', static::OPTIONAL => true],
'assets' => [static::TYPE => AssetCollection::class, static::OPTIONAL => true],
'key' => [static::TYPE => 'string', static::OPTIONAL => true],
];
}
}