Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
feat(Message): add ProductVariantDeleted, ProductDeleted and ProductR…
Browse files Browse the repository at this point in the history
…evertedStagedChanges message

Closes #332
  • Loading branch information
Jens Schulze committed Aug 9, 2017
1 parent 9ea9e22 commit f7291ae
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/Core/Model/Message/ProductDeletedMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* @author @jayS-de <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Model\Message;

use Commercetools\Core\Model\Product\ProductProjection;
use Commercetools\Core\Model\Common\DateTimeDecorator;
use DateTime;
use Commercetools\Core\Model\Common\Reference;

/**
* @package Commercetools\Core\Model\Message
* @link https://dev.commercetools.com/http-api-projects-messages.html#productdeleted-message
* @method string getId()
* @method ProductDeletedMessage setId(string $id = null)
* @method int getVersion()
* @method ProductDeletedMessage setVersion(int $version = null)
* @method DateTimeDecorator getCreatedAt()
* @method ProductDeletedMessage setCreatedAt(DateTime $createdAt = null)
* @method DateTimeDecorator getLastModifiedAt()
* @method ProductDeletedMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
* @method int getSequenceNumber()
* @method ProductDeletedMessage setSequenceNumber(int $sequenceNumber = null)
* @method Reference getResource()
* @method ProductDeletedMessage setResource(Reference $resource = null)
* @method int getResourceVersion()
* @method ProductDeletedMessage setResourceVersion(int $resourceVersion = null)
* @method string getType()
* @method ProductDeletedMessage setType(string $type = null)
* @method array getRemovedImageUrls()
* @method ProductDeletedMessage setRemovedImageUrls(array $removedImageUrls = null)
* @method ProductProjection getCurrentProjection()
* @method ProductDeletedMessage setCurrentProjection(ProductProjection $currentProjection = null)
*/
class ProductDeletedMessage extends Message
{
const MESSAGE_TYPE = 'ProductDeleted';

public function fieldDefinitions()
{
$definitions = parent::fieldDefinitions();
$definitions['removedImageUrls'] = [static::TYPE => 'array'];
$definitions['currentProjection'] = [static::TYPE => ProductProjection::class];

return $definitions;
}
}
3 changes: 3 additions & 0 deletions src/Core/Model/Message/ProductPublishedMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
* @method ProductPublishedMessage setVersion(int $version = null)
* @method DateTimeDecorator getLastModifiedAt()
* @method ProductPublishedMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
* @method array getRemovedImageUrls()
* @method ProductPublishedMessage setRemovedImageUrls(array $removedImageUrls = null)
*/
class ProductPublishedMessage extends Message
{
Expand All @@ -39,6 +41,7 @@ class ProductPublishedMessage extends Message
public function fieldDefinitions()
{
$definitions = parent::fieldDefinitions();
$definitions['removedImageUrls'] = [static::TYPE => 'array'];
$definitions['productProjection'] = [static::TYPE => ProductProjection::class];

return $definitions;
Expand Down
45 changes: 45 additions & 0 deletions src/Core/Model/Message/ProductRevertedStagedChangesMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* @author @jayS-de <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Model\Message;

use Commercetools\Core\Model\Common\DateTimeDecorator;
use DateTime;
use Commercetools\Core\Model\Common\Reference;

/**
* @package Commercetools\Core\Model\Message
* @link https://dev.commercetools.com/http-api-projects-messages.html#productrevertedstagedchanges-message
* @method string getId()
* @method ProductRevertedStagedChangesMessage setId(string $id = null)
* @method int getVersion()
* @method ProductRevertedStagedChangesMessage setVersion(int $version = null)
* @method DateTimeDecorator getCreatedAt()
* @method ProductRevertedStagedChangesMessage setCreatedAt(DateTime $createdAt = null)
* @method DateTimeDecorator getLastModifiedAt()
* @method ProductRevertedStagedChangesMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
* @method int getSequenceNumber()
* @method ProductRevertedStagedChangesMessage setSequenceNumber(int $sequenceNumber = null)
* @method Reference getResource()
* @method ProductRevertedStagedChangesMessage setResource(Reference $resource = null)
* @method int getResourceVersion()
* @method ProductRevertedStagedChangesMessage setResourceVersion(int $resourceVersion = null)
* @method string getType()
* @method ProductRevertedStagedChangesMessage setType(string $type = null)
* @method array getRemovedImageUrls()
* @method ProductRevertedStagedChangesMessage setRemovedImageUrls(array $removedImageUrls = null)
*/
class ProductRevertedStagedChangesMessage extends Message
{
const MESSAGE_TYPE = 'ProductRevertedStagedChanges';

public function fieldDefinitions()
{
$definitions = parent::fieldDefinitions();
$definitions['removedImageUrls'] = [static::TYPE => 'array'];

return $definitions;
}
}
49 changes: 49 additions & 0 deletions src/Core/Model/Message/ProductVariantDeletedMessage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* @author @jayS-de <jens.schulze@commercetools.de>
*/

namespace Commercetools\Core\Model\Message;

use Commercetools\Core\Model\Product\ProductVariant;
use Commercetools\Core\Model\Common\DateTimeDecorator;
use DateTime;
use Commercetools\Core\Model\Common\Reference;

/**
* @package Commercetools\Core\Model\Message
* @link https://dev.commercetools.com/http-api-projects-messages.html#productvariantdeleted-message
* @method string getId()
* @method ProductVariantDeletedMessage setId(string $id = null)
* @method int getVersion()
* @method ProductVariantDeletedMessage setVersion(int $version = null)
* @method DateTimeDecorator getCreatedAt()
* @method ProductVariantDeletedMessage setCreatedAt(DateTime $createdAt = null)
* @method DateTimeDecorator getLastModifiedAt()
* @method ProductVariantDeletedMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
* @method int getSequenceNumber()
* @method ProductVariantDeletedMessage setSequenceNumber(int $sequenceNumber = null)
* @method Reference getResource()
* @method ProductVariantDeletedMessage setResource(Reference $resource = null)
* @method int getResourceVersion()
* @method ProductVariantDeletedMessage setResourceVersion(int $resourceVersion = null)
* @method string getType()
* @method ProductVariantDeletedMessage setType(string $type = null)
* @method array getRemovedImageUrls()
* @method ProductVariantDeletedMessage setRemovedImageUrls(array $removedImageUrls = null)
* @method ProductVariant getVariant()
* @method ProductVariantDeletedMessage setVariant(ProductVariant $variant = null)
*/
class ProductVariantDeletedMessage extends Message
{
const MESSAGE_TYPE = 'ProductVariantDeleted';

public function fieldDefinitions()
{
$definitions = parent::fieldDefinitions();
$definitions['removedImageUrls'] = [static::TYPE => 'array'];
$definitions['variant'] = [static::TYPE => ProductVariant::class];

return $definitions;
}
}

0 comments on commit f7291ae

Please # to comment.