1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jayS-de <[email protected]> |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Model\Message; |
7
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\DateTimeDecorator; |
9
|
|
|
use Commercetools\Core\Model\Common\Image; |
10
|
|
|
use Commercetools\Core\Model\Common\Reference; |
11
|
|
|
use Commercetools\Core\Model\Product\ProductProjection; |
12
|
|
|
use DateTime; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @package Commercetools\Core\Model\Message |
16
|
|
|
* @link https://dev.commercetools.com/http-api-projects-messages.html#productimageadded-message |
17
|
|
|
* @method string getId() |
18
|
|
|
* @method ProductImageAddedMessage setId(string $id = null) |
19
|
|
|
* @method int getVersion() |
20
|
|
|
* @method ProductImageAddedMessage setVersion(int $version = null) |
21
|
|
|
* @method DateTimeDecorator getCreatedAt() |
22
|
|
|
* @method ProductImageAddedMessage setCreatedAt(DateTime $createdAt = null) |
23
|
|
|
* @method DateTimeDecorator getLastModifiedAt() |
24
|
|
|
* @method ProductImageAddedMessage setLastModifiedAt(DateTime $lastModifiedAt = null) |
25
|
|
|
* @method int getSequenceNumber() |
26
|
|
|
* @method ProductImageAddedMessage setSequenceNumber(int $sequenceNumber = null) |
27
|
|
|
* @method Reference getResource() |
28
|
|
|
* @method ProductImageAddedMessage setResource(Reference $resource = null) |
29
|
|
|
* @method int getResourceVersion() |
30
|
|
|
* @method ProductImageAddedMessage setResourceVersion(int $resourceVersion = null) |
31
|
|
|
* @method string getType() |
32
|
|
|
* @method ProductImageAddedMessage setType(string $type = null) |
33
|
|
|
* @method int getVariantId() |
34
|
|
|
* @method ProductImageAddedMessage setVariantId(int $variantId = null) |
35
|
|
|
* @method Image getImage() |
36
|
|
|
* @method ProductImageAddedMessage setImage(Image $image = null) |
37
|
|
|
* @method bool getStaged() |
38
|
|
|
* @method ProductImageAddedMessage setStaged(bool $staged = null) |
39
|
|
|
*/ |
40
|
|
View Code Duplication |
class ProductImageAddedMessage extends Message |
|
|
|
|
41
|
|
|
{ |
42
|
|
|
const MESSAGE_TYPE = 'ProductImageAdded'; |
43
|
|
|
|
44
|
|
|
public function fieldDefinitions() |
45
|
|
|
{ |
46
|
|
|
$definitions = parent::fieldDefinitions(); |
47
|
|
|
$definitions['variantId'] = [static::TYPE => 'int']; |
48
|
|
|
$definitions['image'] = [static::TYPE => Image::class]; |
49
|
|
|
$definitions['staged'] = [static::TYPE => 'bool']; |
50
|
|
|
|
51
|
|
|
return $definitions; |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
|
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.