Completed
Push — master ( 20a9ba...cdeb22 )
by Paweł
23:39 queued 09:59
created

ShipmentUnit::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Component\Shipping\Model;
13
14
use Sylius\Component\Resource\Model\TimestampableTrait;
15
16
/**
17
 * @author Paweł Jędrzejewski <[email protected]>
18
 */
19
class ShipmentUnit implements ShipmentUnitInterface
20
{
21
    use TimestampableTrait;
22
23
    /**
24
     * @var mixed
25
     */
26
    protected $id;
27
28
    /**
29
     * @var ShipmentInterface
30
     */
31
    protected $shipment;
32
33
    /**
34
     * @var ShippableInterface
35
     */
36
    protected $shippable;
37
38
    /**
39
     * @var string
40
     */
41
    protected $shippingState = ShipmentInterface::STATE_READY;
42
43
    public function __construct()
44
    {
45
        $this->createdAt = new \DateTime();
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function __toString()
52
    {
53
        return (string) $this->id;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getId()
60
    {
61
        return $this->id;
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function getShipment()
68
    {
69
        return $this->shipment;
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75
    public function setShipment(ShipmentInterface $shipment = null)
76
    {
77
        $this->shipment = $shipment;
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83
    public function getShippable()
84
    {
85
        return $this->shippable;
86
    }
87
88
    /**
89
     * {@inheritdoc}
90
     */
91
    public function setShippable(ShippableInterface $shippable)
92
    {
93
        $this->shippable = $shippable;
94
    }
95
96
    /**
97
     * {@inheritdoc}
98
     */
99
    public function getShippingState()
100
    {
101
        return $this->shippingState;
102
    }
103
104
    /**
105
     * {@inheritdoc}
106
     */
107
    public function setShippingState($state)
108
    {
109
        $this->shippingState = $state;
110
    }
111
}
112