Country   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A locales() 0 3 1
1
<?php
2
3
namespace Translation\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Country extends Model
8
{
9
    public $incrementing = false;
10
    protected $casts = [
11
        'code' => 'string',
12
    ];
13
    protected $primaryKey = 'code';
14
    protected $keyType = 'string';
15
16
    /**
17
     * The attributes that are mass assignable.
18
     *
19
     * @var array
20
     */
21
    protected $fillable = [
22
        'name',
23
        'code'
24
    ];
25
26
    protected $mappingProperties = array(
27
        'name' => [
28
            'type' => 'string',
29
            "analyzer" => "standard",
30
        ],
31
        'code' => [
32
            'type' => 'string',
33
            "analyzer" => "standard",
34
        ],
35
    );
36
37
    /**
38
     *  Each language may have several translations.
39
     */
40
    public function locales()
41
    {
42
        return $this->hasMany(Locale::class, 'country_code', 'code');
43
    }
44
}
45