ModelRelation::getModel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace BeyondCode\ErdGenerator;
4
use Illuminate\Support\Str;
5
6
class ModelRelation
7
{
8
    private $type;
9
    private $model;
10
    private $localKey;
11
    private $foreignKey;
12
    private $name;
13
14
    public function __construct($name, $type, $model, $localKey = null, $foreignKey)
15
    {
16
        $this->type = $type;
17
        $this->model = $model;
18
        $this->localKey = $localKey;
19
        $this->foreignKey = $foreignKey;
20
        $this->name = $name;
21
    }
22
23
    /**
24
     * @return mixed
25
     */
26
    public function getModel()
27
    {
28
        return $this->model;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getModelNodeName()
35
    {
36
        return Str::slug($this->model);
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getType()
43
    {
44
        return $this->type;
45
    }
46
47
    /**
48
     * @return null
49
     */
50
    public function getLocalKey()
51
    {
52
        return $this->localKey;
53
    }
54
55
    /**
56
     * @return mixed
57
     */
58
    public function getForeignKey()
59
    {
60
        return $this->foreignKey;
61
    }
62
63
    /**
64
     * @return mixed
65
     */
66
    public function getName()
67
    {
68
        return $this->name;
69
    }
70
}
71