From 0e14d97fd4741004e253b62534c06e743843a237 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Thu, 1 Jun 2017 15:09:33 +0200 Subject: [PATCH] feat(Messages): add ProductImageAdded message Closes #314 --- .../Message/ProductImageAddedMessage.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/Core/Model/Message/ProductImageAddedMessage.php diff --git a/src/Core/Model/Message/ProductImageAddedMessage.php b/src/Core/Model/Message/ProductImageAddedMessage.php new file mode 100644 index 0000000000..3e22034968 --- /dev/null +++ b/src/Core/Model/Message/ProductImageAddedMessage.php @@ -0,0 +1,53 @@ + + */ + +namespace Commercetools\Core\Model\Message; + +use Commercetools\Core\Model\Common\DateTimeDecorator; +use Commercetools\Core\Model\Common\Image; +use Commercetools\Core\Model\Common\Reference; +use Commercetools\Core\Model\Product\ProductProjection; +use DateTime; + +/** + * @package Commercetools\Core\Model\Message + * @link https://dev.commercetools.com/http-api-projects-messages.html#productimageadded-message + * @method string getId() + * @method ProductImageAddedMessage setId(string $id = null) + * @method int getVersion() + * @method ProductImageAddedMessage setVersion(int $version = null) + * @method DateTimeDecorator getCreatedAt() + * @method ProductImageAddedMessage setCreatedAt(DateTime $createdAt = null) + * @method DateTimeDecorator getLastModifiedAt() + * @method ProductImageAddedMessage setLastModifiedAt(DateTime $lastModifiedAt = null) + * @method int getSequenceNumber() + * @method ProductImageAddedMessage setSequenceNumber(int $sequenceNumber = null) + * @method Reference getResource() + * @method ProductImageAddedMessage setResource(Reference $resource = null) + * @method int getResourceVersion() + * @method ProductImageAddedMessage setResourceVersion(int $resourceVersion = null) + * @method string getType() + * @method ProductImageAddedMessage setType(string $type = null) + * @method int getVariantId() + * @method ProductImageAddedMessage setVariantId(int $variantId = null) + * @method Image getImage() + * @method ProductImageAddedMessage setImage(Image $image = null) + * @method bool getStaged() + * @method ProductImageAddedMessage setStaged(bool $staged = null) + */ +class ProductImageAddedMessage extends Message +{ + const MESSAGE_TYPE = 'ProductImageAdded'; + + public function fieldDefinitions() + { + $definitions = parent::fieldDefinitions(); + $definitions['variantId'] = [static::TYPE => 'int']; + $definitions['image'] = [static::TYPE => Image::class]; + $definitions['staged'] = [static::TYPE => 'bool']; + + return $definitions; + } +}