Completed
Push — master ( 856811...eec34e )
by Siim
12:20
created

OrdersTrait::getOrders()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: siim
5
 * Date: 31.01.19
6
 * Time: 9:44
7
 */
8
9
namespace Sf4\Api\Dto\Traits;
10
11
use Doctrine\Common\Collections\ArrayCollection;
12
use Sf4\Api\Dto\Order\OrderInterface;
13
14
trait OrdersTrait
15
{
16
17
    /** @var ArrayCollection $orders */
18
    private $orders;
19
20
    /**
21
     * @return ArrayCollection
22
     */
23
    public function getOrders(): ArrayCollection
24
    {
25
        return $this->orders;
26
    }
27
28
    /**
29
     * @param OrderInterface|null $order
30
     */
31
    public function addOrder(OrderInterface $order): void
32
    {
33
        $this->orders->add($order);
34
    }
35
36
    /**
37
     * @param ArrayCollection $orders
38
     */
39
    public function setOrders(ArrayCollection $orders)
40
    {
41
        $this->orders = $orders;
42
    }
43
}
44