Model::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
5
use Illuminate\Support\Collection;
6
use Illuminate\Support\Str;
7
8
class Model
9
{
10
    private $model;
11
    private $label;
12
    private $relations;
13
14
    public function __construct(string $model, string $label, Collection $relations)
15
    {
16
        $this->model = $model;
17
        $this->label = $label;
18
        $this->relations = $relations;
19
    }
20
21
    /**
22
     * @return mixed
23
     */
24
    public function getModel()
25
    {
26
        return $this->model;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getNodeName()
33
    {
34
        return str_replace('-', '', Str::slug($this->model));
35
    }
36
37
    /**
38
     * @return mixed
39
     */
40
    public function getLabel()
41
    {
42
        return $this->label;
43
    }
44
45
    /**
46
     * @return Collection
47
     */
48
    public function getRelations()
49
    {
50
        return $this->relations;
51
    }
52
}
53