PersonEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 26
c 1
b 0
f 0
dl 0
loc 41
rs 10
wmc 2

2 Methods

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