This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Message): add ProductVariantDeleted, ProductDeleted and ProductR…
…evertedStagedChanges message Closes #332
- Loading branch information
Jens Schulze
committed
Aug 9, 2017
1 parent
9ea9e22
commit f7291ae
Showing
4 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/Core/Model/Message/ProductRevertedStagedChangesMessage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |