Order::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Predictator\AssociationRule;
4
5
6
class Order implements OrderInterface
7
{
8
	/**
9
	 * @var string
10
	 */
11
	private $id;
12
13
	/**
14
	 * @var ProductInterface[]
15
	 */
16
	private $orderItems = array();
17
18
	/**
19
	 * @param string $id
20
	 */
21
	public function __construct(string $id)
22
	{
23
		$this->id = $id;
24
	}
25
26
	/**
27
	 * @param ProductInterface $orderItem
28
	 */
29
	public function addOrderItem(ProductInterface $orderItem)
30
	{
31
		$this->orderItems[] = $orderItem;
32
	}
33
34
	/**
35
	 * @return string
36
	 */
37
	public function getId(): string
38
	{
39
		return $this->id;
40
	}
41
42
	/**
43
	 * @return ProductInterface[]
44
	 */
45
	public function getOrderProducts(): array
46
	{
47
		return $this->orderItems;
48
	}
49
}