1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jenschude <[email protected]> |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Model\Message; |
7
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\DateTimeDecorator; |
9
|
|
|
use Commercetools\Core\Model\Common\Reference; |
10
|
|
|
use Commercetools\Core\Model\Order\Delivery; |
11
|
|
|
use DateTime; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @package Commercetools\Core\Model\Message |
15
|
|
|
* @link https://docs.commercetools.com/http-api-projects-messages.html#deliveryadded-message |
16
|
|
|
* @method string getId() |
17
|
|
|
* @method DeliveryAddedMessage setId(string $id = null) |
18
|
|
|
* @method DateTimeDecorator getCreatedAt() |
19
|
|
|
* @method DeliveryAddedMessage setCreatedAt(DateTime $createdAt = null) |
20
|
|
|
* @method int getSequenceNumber() |
21
|
|
|
* @method DeliveryAddedMessage setSequenceNumber(int $sequenceNumber = null) |
22
|
|
|
* @method Reference getResource() |
23
|
|
|
* @method DeliveryAddedMessage setResource(Reference $resource = null) |
24
|
|
|
* @method int getResourceVersion() |
25
|
|
|
* @method DeliveryAddedMessage setResourceVersion(int $resourceVersion = null) |
26
|
|
|
* @method string getType() |
27
|
|
|
* @method DeliveryAddedMessage setType(string $type = null) |
28
|
|
|
* @method Delivery getDelivery() |
29
|
|
|
* @method DeliveryAddedMessage setDelivery(Delivery $delivery = null) |
30
|
|
|
* @method int getVersion() |
31
|
|
|
* @method DeliveryAddedMessage setVersion(int $version = null) |
32
|
|
|
* @method DateTimeDecorator getLastModifiedAt() |
33
|
|
|
* @method DeliveryAddedMessage setLastModifiedAt(DateTime $lastModifiedAt = null) |
34
|
|
|
*/ |
35
|
|
View Code Duplication |
class DeliveryAddedMessage extends Message |
|
|
|
|
36
|
|
|
{ |
37
|
|
|
const MESSAGE_TYPE = 'DeliveryAdded'; |
38
|
|
|
|
39
|
1 |
|
public function fieldDefinitions() |
40
|
|
|
{ |
41
|
1 |
|
$definitions = parent::fieldDefinitions(); |
42
|
1 |
|
$definitions['delivery'] = [static::TYPE => Delivery::class]; |
43
|
|
|
|
44
|
1 |
|
return $definitions; |
45
|
|
|
} |
46
|
|
|
} |
47
|
|
|
|
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.