Passed
Push — master ( 8372f4...8e3d45 )
by Davide
07:49 queued 11s
created

Region   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 8
dl 0
loc 31
ccs 0
cts 3
cp 0
rs 10
c 1
b 1
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRegionName() 0 5 1
1
<?php
2
3
namespace DavideCasiraghi\LaravelEventsCalendar\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Astrotomic\Translatable\Translatable;
7
8
class Region extends Model
9
{
10
    /***************************************************************************/
11
    /**
12
     * The table associated with the model.
13
     *
14
     * @var string
15
     */
16
    protected $table = 'regions';
17
18
    /***************************************************************************/
19
20
    use Translatable;
21
22
    public $translatedAttributes = ['name', 'slug'];
23
    protected $fillable = ['country_id','timezone'];
24
    public $useTranslationFallback = true;
25
26
    /***************************************************************************/
27
28
    /*
29
     * Return the region name.
30
     *
31
     * @param  int  $regionId
32
     * @return string
33
     */
34
    public static function getRegionName($regionId)
35
    {
36
        $ret = self::find($regionId)->name;
37
38
        return $ret;
39
    }
40
    
41
42
}
43