Completed
Push — develop ( b6cb2c...9ca58c )
by Jens
15:17 queued 07:08
created

Extension::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 16
ccs 10
cts 10
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 */
4
5
namespace Commercetools\Core\Model\Extension;
6
7
use Commercetools\Core\Model\Common\DateTimeDecorator;
8
use Commercetools\Core\Model\Common\Resource;
9
use DateTime;
10
11
/**
12
 * @package Commercetools\Core\Model\Extension
13
 *
14
 * @method string getId()
15
 * @method Extension setId(string $id = null)
16
 * @method int getVersion()
17
 * @method Extension setVersion(int $version = null)
18
 * @method DateTimeDecorator getCreatedAt()
19
 * @method Extension setCreatedAt(DateTime $createdAt = null)
20
 * @method DateTimeDecorator getLastModifiedAt()
21
 * @method Extension setLastModifiedAt(DateTime $lastModifiedAt = null)
22
 * @method string getKey()
23
 * @method Extension setKey(string $key = null)
24
 * @method Destination getDestination()
25
 * @method Extension setDestination(Destination $destination = null)
26
 * @method TriggerCollection getTriggers()
27
 * @method Extension setTriggers(TriggerCollection $triggers = null)
28
 */
29
class Extension extends Resource
30
{
31 5
    public function fieldDefinitions()
32
    {
33
        return [
34 5
            'id' => [static::TYPE => 'string'],
35 5
            'version' => [static::TYPE => 'int'],
36
            'createdAt' => [
37 5
                static::TYPE => DateTime::class,
38 5
                static::DECORATOR => DateTimeDecorator::class
39
            ],
40
            'lastModifiedAt' => [
41 5
                static::TYPE => DateTime::class,
42 5
                static::DECORATOR => DateTimeDecorator::class
43
            ],
44 5
            'key' => [static::TYPE => 'string'],
45 5
            'destination' => [static::TYPE => Destination::class],
46 5
            'triggers' => [static::TYPE => TriggerCollection::class],
47
        ];
48
    }
49
}
50