Completed
Push — master ( 18bfc7...82e0b5 )
by Jens
18:00 queued 05:19
created

MessageDelivery::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 0
cts 22
cp 0
rs 9.2
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Subscription;
7
8
use Commercetools\Core\Model\Common\Reference;
9
use Commercetools\Core\Model\Common\DateTimeDecorator;
10
11
/**
12
 * @package Commercetools\Core\Model\Subscription
13
 * @method string getProjectKey()
14
 * @method MessageDelivery setProjectKey(string $projectKey = null)
15
 * @method string getNotificationType()
16
 * @method MessageDelivery setNotificationType(string $notificationType = null)
17
 * @method Reference getResource()
18
 * @method MessageDelivery setResource(Reference $resource = null)
19
 * @method string getId()
20
 * @method MessageDelivery setId(string $id = null)
21
 * @method int getVersion()
22
 * @method MessageDelivery setVersion(int $version = null)
23
 * @method int getSequenceNumber()
24
 * @method MessageDelivery setSequenceNumber(int $sequenceNumber = null)
25
 * @method int getResourceVersion()
26
 * @method MessageDelivery setResourceVersion(int $resourceVersion = null)
27
 * @method DateTimeDecorator getCreatedAt()
28
 * @method MessageDelivery setCreatedAt(\DateTime $createdAt = null)
29
 * @method DateTimeDecorator getLastModifiedAt()
30
 * @method MessageDelivery setLastModifiedAt(\DateTime $lastModifiedAt = null)
31
 */
32
class MessageDelivery extends Delivery
33
{
34
    public function fieldDefinitions()
35
    {
36
        $definition = parent::fieldDefinitions();
37
        $definition = array_merge(
38
            $definition,
39
            [
40
                'id' => [static::TYPE => 'string'],
41
                'version' => [static::TYPE => 'int'],
42
                'sequenceNumber' => [static::TYPE => 'int'],
43
                'resourceVersion' => [static::TYPE => 'int'],
44
                'createdAt' => [
45
                    static::TYPE => '\DateTime',
46
                    static::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator'
47
                ],
48
                'lastModifiedAt' => [
49
                    static::TYPE => '\DateTime',
50
                    static::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator'
51
                ],
52
            ]
53
        );
54
        return $definition;
55
    }
56
}
57