BankEntry   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 3
eloc 28
c 4
b 1
f 0
dl 0
loc 39
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addItem() 0 6 3
1
<?php
2
3
namespace Picqer\Financials\Exact;
4
5
/**
6
 * Class BankEntry.
7
 *
8
 * @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=FinancialTransactionBankEntries
9
 *
10
 * @property string $EntryID Primary key
11
 * @property BankEntryLines $BankEntryLines Collection of lines
12
 * @property string $BankStatementDocument Reference to document with bank statement
13
 * @property int $BankStatementDocumentNumber Document number of document with bank statement
14
 * @property string $BankStatementDocumentSubject Subject of document with bank statement
15
 * @property float $ClosingBalanceFC Closing balance in the currency of the transaction
16
 * @property string $Created Creation date
17
 * @property string $Currency Currency code
18
 * @property int $Division Division code
19
 * @property int $EntryNumber Entry number
20
 * @property int $FinancialPeriod Financial period
21
 * @property int $FinancialYear Financial year
22
 * @property string $JournalCode Code of Journal
23
 * @property string $JournalDescription Description of Journal
24
 * @property string $Modified Last modified date
25
 * @property float $OpeningBalanceFC Opening balance in the currency of the transaction
26
 * @property int $Status Status: 5 = Rejected, 20 = Open, 50 = Processed
27
 * @property string $StatusDescription Description of Status
28
 */
29
class BankEntry extends Model
30
{
31
    use Query\Findable;
32
    use Persistance\Storable;
33
34
    protected $primaryKey = 'EntryID';
35
36
    protected $bankEntryLines = [];
37
38
    protected $fillable = [
39
        'EntryID',
40
        'BankEntryLines',
41
        'BankStatementDocument',
42
        'BankStatementDocumentNumber',
43
        'BankStatementDocumentSubject',
44
        'ClosingBalanceFC',
45
        'Created',
46
        'Currency',
47
        'Division',
48
        'EntryNumber',
49
        'FinancialPeriod',
50
        'FinancialYear',
51
        'JournalCode',
52
        'JournalDescription',
53
        'Modified',
54
        'OpeningBalanceFC',
55
        'Status',
56
        'StatusDescription',
57
    ];
58
59
    public function addItem(array $array)
60
    {
61
        if (! isset($this->attributes['BankEntryLines']) || $this->attributes['BankEntryLines'] == null) {
62
            $this->attributes['BankEntryLines'] = [];
63
        }
64
        $this->attributes['BankEntryLines'][] = $array;
65
    }
66
67
    protected $url = 'financialtransaction/BankEntries';
68
}
69