Passed
Push — master ( 51edae...d29a9b )
by Curtis
11:52 queued 05:54
created

PersonEvent::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\SoftDeletes;
6
use ModularSoftware\LaravelGedcom\Observers\EventActionsObserver;
7
use LaravelEnso\Tables\Traits\TableCache;
8
9
class PersonEvent extends Event
10
{
11
    use TableCache;
12
    use SoftDeletes;
13
14
    protected $dates = ['deleted_at'];
15
16
    protected $table = 'person_events';
17
18
    protected $fillable = [
19
        'person_id',
20
        'title',
21
        'type',
22
        'attr',
23
        'date',
24
        'plac',
25
        'phon',
26
        'caus',
27
        'age',
28
        'agnc',
29
        'places_id',
30
        'description',
31
        'year',
32
        'month',
33
        'day',
34
    ];
35
36
    protected $gedcom_event_names = [
37
        'BIRT' => 'Birth',
38
        'DEAT' => 'Death',
39
    ];
40
41
    public static function boot()
42
    {
43
        parent::boot();
44
45
        self::observe(new EventActionsObserver);
46
    }
47
48
    public function person()
49
    {
50
        return $this->hasOne(Person::class, 'id', 'person_id');
51
    }
52
}
53