Hierarchy   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A term() 0 4 1
A parent() 0 4 1
1
<?php
2
3
/**
4
 * Represents thelinks between parents and children terms.
5
 */
6
namespace Rocket\Taxonomy\Model;
7
8
use Illuminate\Database\Eloquent\Model;
9
10
/**
11
 * Parent-child relations between terms
12
 *
13
 * @property int $term_id
14
 * @property int $parent_id
15
 */
16
class Hierarchy extends Model
17
{
18
    /**
19
     * @var bool Indicates if the model should be timestamped.
20
     */
21
    public $timestamps = false;
22
23
    /**
24
     * @var string The table associated with the model.
25
     */
26
    protected $table = 'taxonomy_term_hierarchy';
27
28
    /**
29
     * Get the term related to this entry
30
     *
31
     * @codeCoverageIgnore
32
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
33
     */
34
    public function term()
35
    {
36
        return $this->belongsTo(TermContainer::class, 'term_id');
37
    }
38
39
    /**
40
     * Get the parent term of this entry
41
     *
42
     * @codeCoverageIgnore
43
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
44
     */
45
    public function parent()
46
    {
47
        return $this->belongsTo(TermContainer::class, 'parent_id');
48
    }
49
}
50