Passed
Branch php-scrutinizer (0ac9d8)
by Jens
09:19
created

InventoryEntry::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 15
cts 15
cp 1
rs 9.0856
c 0
b 0
f 0
cc 1
eloc 18
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Inventory;
7
8
use Commercetools\Core\Model\Common\Resource;
9
use Commercetools\Core\Model\Channel\ChannelReference;
10
use Commercetools\Core\Model\Common\DateTimeDecorator;
11
use Commercetools\Core\Model\CustomField\CustomFieldObject;
12
use DateTime;
13
14
/**
15
 * @package Commercetools\Core\Model\Inventory
16
 * @link https://docs.commercetools.com/http-api-projects-inventory.html#inventoryentry
17
 * @method string getId()
18
 * @method InventoryEntry setId(string $id = null)
19
 * @method int getVersion()
20
 * @method InventoryEntry setVersion(int $version = null)
21
 * @method DateTimeDecorator getCreatedAt()
22
 * @method InventoryEntry setCreatedAt(DateTime $createdAt = null)
23
 * @method DateTimeDecorator getLastModifiedAt()
24
 * @method InventoryEntry setLastModifiedAt(DateTime $lastModifiedAt = null)
25
 * @method string getSku()
26
 * @method InventoryEntry setSku(string $sku = null)
27
 * @method ChannelReference getSupplyChannel()
28
 * @method InventoryEntry setSupplyChannel(ChannelReference $supplyChannel = null)
29
 * @method int getQuantityOnStock()
30
 * @method InventoryEntry setQuantityOnStock(int $quantityOnStock = null)
31
 * @method int getAvailableQuantity()
32
 * @method InventoryEntry setAvailableQuantity(int $availableQuantity = null)
33
 * @method int getRestockableInDays()
34
 * @method InventoryEntry setRestockableInDays(int $restockableInDays = null)
35
 * @method DateTimeDecorator getExpectedDelivery()
36
 * @method InventoryEntry setExpectedDelivery(DateTime $expectedDelivery = null)
37
 * @method CustomFieldObject getCustom()
38
 * @method InventoryEntry setCustom(CustomFieldObject $custom = null)
39
 */
40
class InventoryEntry extends Resource
41
{
42 17
    public function fieldDefinitions()
43
    {
44
        return [
45 17
            'id' => [static::TYPE => 'string'],
46 17
            'version' => [static::TYPE => 'int'],
47
            'createdAt' => [
48 17
                static::TYPE => DateTime::class,
49 17
                static::DECORATOR => DateTimeDecorator::class
50
            ],
51
            'lastModifiedAt' => [
52 17
                static::TYPE => DateTime::class,
53 17
                static::DECORATOR => DateTimeDecorator::class
54
            ],
55 17
            'sku' => [static::TYPE => 'string'],
56 17
            'supplyChannel' => [static::TYPE => ChannelReference::class],
57 17
            'quantityOnStock' => [static::TYPE => 'int'],
58 17
            'availableQuantity' => [static::TYPE => 'int'],
59 17
            'restockableInDays' => [static::TYPE => 'int'],
60
            'expectedDelivery' => [
61 17
                static::TYPE => DateTime::class,
62 17
                static::DECORATOR => DateTimeDecorator::class
63
            ],
64 17
            'custom' => [static::TYPE => CustomFieldObject::class],
65
        ];
66
    }
67
}
68