Vocabulary::isTranslatable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
crap 2
1
<?php
2
3
/**
4
 * A vocabulary can contain any number of terms
5
 */
6
namespace Rocket\Taxonomy\Model;
7
8
use Illuminate\Database\Eloquent\Model;
9
10
/**
11
 * The vocabularies in which you add terms
12
 *
13
 * @property int $id
14
 * @property string $machine_name
15
 * @property string $description
16
 * @property int $hierarchy
17
 * @property bool $translatable
18
 */
19
class Vocabulary extends Model
20
{
21
    // 0 = disabled, 1 = single, 2 = multiple
22
    public static $HIERARCHY_FLAT = 0;
23
    public static $HIERARCHY_SINGLE_PARENT = 1;
24
    public static $HIERARCHY_MULTIPLE_PARENT = 2;
25
26
    /**
27
     * @var bool Indicates if the model should be timestamped.
28
     */
29
    public $timestamps = false;
30
31
    /**
32
     * @var string The table associated with the model.
33
     */
34
    protected $table = 'taxonomy_vocabularies';
35
36
    /**
37
     * @var array The attributes that are mass assignable.
38
     */
39
    protected $fillable = ['name', 'machine_name', 'description', 'hierarchy', 'translatable'];
40
41 180
    /**
42
     * Gives the information if a vocabulary is translatable or not
43 180
     *
44
     * @return bool
45
     */
46
    public function isTranslatable()
47
    {
48
        return (bool) $this->translatable;
49
    }
50
}
51