1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jayS-de <[email protected]> |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Model\Message; |
7
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Product\ProductVariant; |
9
|
|
|
use Commercetools\Core\Model\Common\DateTimeDecorator; |
10
|
|
|
use DateTime; |
11
|
|
|
use Commercetools\Core\Model\Common\Reference; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @package Commercetools\Core\Model\Message |
15
|
|
|
* @link https://dev.commercetools.com/http-api-projects-messages.html#productvariantdeleted-message |
16
|
|
|
* @method string getId() |
17
|
|
|
* @method ProductVariantDeletedMessage setId(string $id = null) |
18
|
|
|
* @method int getVersion() |
19
|
|
|
* @method ProductVariantDeletedMessage setVersion(int $version = null) |
20
|
|
|
* @method DateTimeDecorator getCreatedAt() |
21
|
|
|
* @method ProductVariantDeletedMessage setCreatedAt(DateTime $createdAt = null) |
22
|
|
|
* @method DateTimeDecorator getLastModifiedAt() |
23
|
|
|
* @method ProductVariantDeletedMessage setLastModifiedAt(DateTime $lastModifiedAt = null) |
24
|
|
|
* @method int getSequenceNumber() |
25
|
|
|
* @method ProductVariantDeletedMessage setSequenceNumber(int $sequenceNumber = null) |
26
|
|
|
* @method Reference getResource() |
27
|
|
|
* @method ProductVariantDeletedMessage setResource(Reference $resource = null) |
28
|
|
|
* @method int getResourceVersion() |
29
|
|
|
* @method ProductVariantDeletedMessage setResourceVersion(int $resourceVersion = null) |
30
|
|
|
* @method string getType() |
31
|
|
|
* @method ProductVariantDeletedMessage setType(string $type = null) |
32
|
|
|
* @method array getRemovedImageUrls() |
33
|
|
|
* @method ProductVariantDeletedMessage setRemovedImageUrls(array $removedImageUrls = null) |
34
|
|
|
* @method ProductVariant getVariant() |
35
|
|
|
* @method ProductVariantDeletedMessage setVariant(ProductVariant $variant = null) |
36
|
|
|
*/ |
37
|
|
|
class ProductVariantDeletedMessage extends Message |
38
|
|
|
{ |
39
|
|
|
const MESSAGE_TYPE = 'ProductVariantDeleted'; |
40
|
|
|
|
41
|
|
View Code Duplication |
public function fieldDefinitions() |
|
|
|
|
42
|
|
|
{ |
43
|
|
|
$definitions = parent::fieldDefinitions(); |
44
|
|
|
$definitions['removedImageUrls'] = [static::TYPE => 'array']; |
45
|
|
|
$definitions['variant'] = [static::TYPE => ProductVariant::class]; |
46
|
|
|
|
47
|
|
|
return $definitions; |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.