Passed
Push — main ( ecd12d...3c3a9e )
by Thierry
05:54
created

Settlement   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A bill() 0 3 1
A session() 0 3 1
A scopeWhereSession() 0 3 1
A fund() 0 3 1
1
<?php
2
3
namespace Siak\Tontine\Model;
4
5
use Illuminate\Database\Eloquent\Builder;
6
7
class Settlement extends Base
8
{
9
    /**
10
     * Indicates if the model should be timestamped.
11
     *
12
     * @var bool
13
     */
14
    public $timestamps = false;
15
16
    public function bill()
17
    {
18
        return $this->belongsTo(Bill::class);
19
    }
20
21
    public function session()
22
    {
23
        return $this->belongsTo(Session::class);
24
    }
25
26
    public function fund()
27
    {
28
        return $this->belongsTo(Fund::class);
29
    }
30
31
    /**
32
     * @param  Builder  $query
33
     * @param  Session  $session
34
     *
35
     * @return Builder
36
     */
37
    public function scopeWhereSession(Builder $query, Session $session): Builder
38
    {
39
        return $query->where('session_id', $session->id);
40
    }
41
}
42