Passed
Pull Request — master (#209)
by
unknown
10:30
created

Script::getIsoAlpha()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Script Entity.
4
 *
5
 * @package App\Entities\Script
6
 *
7
 * @author    Nick Menke <[email protected]>
8
 * @copyright 2018-2020 Nick Menke
9
 *
10
 * @link https://github.com/nlmenke/vertebrae
11
 */
12
13
declare(strict_types=1);
14
15
namespace App\Entities\Script;
16
17
use App\Entities\AbstractEntity;
18
use App\Entities\Locale\Locale;
19
use Illuminate\Database\Eloquent\Relations\HasMany;
20
use Illuminate\Database\Eloquent\SoftDeletes;
21
22
/**
23
 * The Script entity class.
24
 *
25
 * This class contains any functions required to access and manipulate script
26
 * models.
27
 *
28
 * @since x.x.x introduced
29
 */
30
class Script extends AbstractEntity
31
{
32
    use SoftDeletes;
33
34
    /**
35
     * The attributes that are mass assignable.
36
     *
37
     * @var array
38
     */
39
    protected $fillable = [
40
        'iso_alpha',
41
        'iso_numeric',
42
        'name',
43
        'direction',
44
    ];
45
46
    /**
47
     * Get the direction attribute.
48
     *
49
     * @return string
50
     */
51
    public function getDirection(): string
52
    {
53
        return $this->getAttribute('direction');
54
    }
55
56
    /**
57
     * Get the iso_alpha attribute.
58
     *
59
     * @return string
60
     */
61
    public function getIsoAlpha(): string
62
    {
63
        return $this->getAttribute('iso_alpha');
64
    }
65
66
    /**
67
     * Get the iso_numeric attribute.
68
     *
69
     * @return string
70
     */
71
    public function getIsoNumeric(): string
72
    {
73
        return $this->getAttribute('iso_numeric');
74
    }
75
76
    /**
77
     * Get the name attribute.
78
     *
79
     * @return string
80
     */
81
    public function getName(): string
82
    {
83
        return $this->getAttribute('name');
84
    }
85
86
    /**
87
     * The locales relationship instance.
88
     *
89
     * @return HasMany
90
     */
91
    public function locales(): HasMany
92
    {
93
        return $this->hasMany(Locale::class);
94
    }
95
}
96