Passed
Push — master ( 1588bf...13dcb2 )
by Davide
08:28
created

EventCategory::getCategoryName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace DavideCasiraghi\LaravelEventsCalendar\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class EventCategory extends Model
8
{
9
    /***************************************************************************/
10
    /**
11
     * The table associated with the model.
12
     *
13
     * @var string
14
     */
15
    protected $table = 'event_categories';
16
17
    /***************************************************************************/
18
19
    use \Dimsav\Translatable\Translatable;
0 ignored issues
show
introduced by
The trait Dimsav\Translatable\Translatable requires some properties which are not provided by DavideCasiraghi\LaravelE...ar\Models\EventCategory: $translations, $translationModel, $localeKey, $translationForeignKey
Loading history...
20
21
    public $translatedAttributes = ['name', 'slug'];
22
    protected $fillable = [];
23
    public $useTranslationFallback = true;
24
25
    /***************************************************************************/
26
27
    /*
28
     * Return the category name.
29
     *
30
     * @param  int  $categoryId
31
     * @return string
32
     */
33
    public static function getCategoryName($categoryId)
34
    {
35
        $ret = self::find($categoryId)->name;
0 ignored issues
show
Bug introduced by
The property name does not seem to exist on DavideCasiraghi\LaravelE...ar\Models\EventCategory. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
36
37
        return $ret;
38
    }
39
}
40