PersonEvent::person()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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