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

OrdersTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setOrders() 0 3 1
A addOrder() 0 3 1
A getOrders() 0 3 1
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