Completed
Push — master ( ba992d...dc755b )
by Davide
07:03
created

EventCategory::getCategoryName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App;
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;
20
21
    public $translatedAttributes = ['name', 'slug'];
22
    protected $fillable = [];
23
24
    /***************************************************************************/
25
26
    /**
27
     * Return the category name.
28
     *
29
     * @param  int  $categoryId
30
     * @return string
31
     */
32
    public static function getCategoryName($categoryId)
33
    {
34
        $ret = self::find($categoryId)->name;
35
36
        return $ret;
37
    }
38
}
39