Completed
Pull Request — master (#20)
by Yann
02:45
created

Record::getAccount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Genkgo\Camt\DTO;
4
5
/**
6
 * Class Record
7
 * @package Genkgo\Camt\DTO
8
 */
9
abstract class Record
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $id;
15
16
    /**
17
     * @var \DateTimeImmutable
18
     */
19
    protected $createdOn;
20
21
    /**
22
     * @var Account
23
     */
24
    protected $account;
25
26
    /**
27
     * @var array
28
     */
29
    protected $entries = [];
30
31
    /**
32
     * @param string $id
33
     * @param \DateTimeImmutable $createdOn
34
     * @param Account $account
35
     */
36 15
    public function __construct($id, \DateTimeImmutable $createdOn, Account $account)
37
    {
38 15
        $this->id = $id;
39 15
        $this->createdOn = $createdOn;
40 15
        $this->account = $account;
41 15
    }
42
43
    /**
44
     * @return string
45
     */
46 2
    public function getId()
47
    {
48 2
        return $this->id;
49
    }
50
51
    /**
52
     * @return \DateTimeImmutable
53
     */
54 2
    public function getCreatedOn()
55
    {
56 2
        return $this->createdOn;
57
    }
58
59
    /**
60
     * @return Account
61
     */
62 2
    public function getAccount()
63
    {
64 2
        return $this->account;
65
    }
66
67
    /**
68
     * @param Entry $entry
69
     */
70 13
    public function addEntry(Entry $entry)
71
    {
72 13
        $this->entries[] = $entry;
73 13
    }
74
75
    /**
76
     * @return Entry[]
77
     */
78 4
    public function getEntries()
79
    {
80 4
        return $this->entries;
81
    }
82
}
83