Total Complexity | 2 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Category extends Model |
||
8 | { |
||
9 | /***************************************************************************/ |
||
10 | /** |
||
11 | * The table associated with the model. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $table = 'categories'; |
||
16 | |||
17 | /***************************************************************************/ |
||
18 | |||
19 | use \Dimsav\Translatable\Translatable; |
||
|
|||
20 | |||
21 | public $translatedAttributes = ['name', 'description', 'slug']; |
||
22 | protected $fillable = []; |
||
23 | public $useTranslationFallback = true; |
||
24 | |||
25 | /***************************************************************************/ |
||
26 | |||
27 | /** |
||
28 | * Return the post categories array |
||
29 | * the collection is transferred to an array to symulate the pluck behaviour, |
||
30 | * and get the category name translated or the relative fallbacks. |
||
31 | * (otherwise the pluck has empty names because doesn't fallback). |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public static function getCategoriesArray() |
||
62 |