CashEntry   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 25
c 1
b 0
f 0
dl 0
loc 35
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 CashEntry.
7
 *
8
 * @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=financialtransactionCashEntries
9
 *
10
 * @property string $EntryID Primary key (read-only)
11
 * @property float $ClosingBalanceFC Closing balance in the currency of the transaction
12
 * @property string $Created Creation date (read-only)
13
 * @property float $Currency Closing balance in the currency of the transaction
14
 * @property int $Division Division code (read-only)
15
 * @property int $EntryNumber Entry number
16
 * @property int $FinancialPeriod Fiancial period
17
 * @property int $FinancialYear Fiancial year
18
 * @property CashEntryLines $CashEntryLines Collection of lines
19
 * @property string $JournalCode Code of Journal
20
 * @property string $JournalDescription Description of Journal (read-only)
21
 * @property string $Modified Last modified date (read-only)
22
 * @property float $OpeningBalanceFC Opening balance in the currency of the transaction
23
 * @property int $Status Status: 5 = Rejected, 20 = Open, 50 = Processed (read-only)
24
 * @property string $StatusDescription Description of Status (read-only)
25
 */
26
class CashEntry extends Model
27
{
28
    use Query\Findable;
29
    use Persistance\Storable;
30
31
    protected $primaryKey = 'EntryID';
32
    protected $cashEntryLines = [];
33
34
    protected $fillable = [
35
        'EntryID',
36
        'ClosingBalanceFC',
37
        'Created',
38
        'Currency',
39
        'Division',
40
        'EntryNumber',
41
        'FinancialPeriod',
42
        'FinancialYear',
43
        'CashEntryLines',
44
        'JournalCode',
45
        'JournalDescription',
46
        'Modified',
47
        'OpeningBalanceFC',
48
        'Status',
49
        'StatusDescription',
50
    ];
51
52
    public function addItem(array $array)
53
    {
54
        if (! isset($this->attributes['CashEntryLines']) || $this->attributes['CashEntryLines'] == null) {
55
            $this->attributes['CashEntryLines'] = [];
56
        }
57
        $this->attributes['CashEntryLines'][] = $array;
58
    }
59
60
    protected $url = 'financialtransaction/CashEntries';
61
}
62