Completed
Push — master ( edb9ee...b465c5 )
by
unknown
10:14
created

Translation   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 51
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A translatable() 0 4 1
1
<?php
2
3
namespace BBSLab\NovaTranslation\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\MorphTo;
7
8
/**
9
 * @property int $locale_id
10
 * @property int $translation_id
11
 * @property int $translatable_id
12
 * @property string $translatable_type
13
 */
14
class Translation extends Model
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    protected $table = 'translations';
20
21
    /**
22
     * {@inheritdoc}
23
     */
24
    protected $primaryKey = null;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public $incrementing = false;
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public $timestamps = false;
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    protected $fillable = [
40
        'locale_id',
41
        'translation_id',
42
        'translatable_id',
43
        'translatable_type',
44
    ];
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    protected $casts = [
50
        'locale_id' => 'integer',
51
        'translation_id' => 'integer',
52
        'translatable_id' => 'integer',
53
    ];
54
55
    /**
56
     * Translatable polymorphic relationship.
57
     *
58
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
59
     */
60
    public function translatable(): MorphTo
61
    {
62
        return $this->morphTo();
63
    }
64
}
65