SearchResult   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 144
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 13
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 144
ccs 37
cts 37
cp 1
rs 10

13 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A setBundle() 0 4 1
A getBundle() 0 4 1
A setClass() 0 4 1
A getClass() 0 4 1
A setId() 0 4 1
A getId() 0 4 1
A setRoute() 0 4 1
A getRoute() 0 4 1
A setTitle() 0 4 1
A getTitle() 0 4 1
A setWeight() 0 4 1
A getWeight() 0 4 1
1
<?php
2
3
namespace SumoCoders\FrameworkSearchBundle\Entity;
4
5
class SearchResult
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $bundle;
11
12
    /**
13
     * @var string
14
     */
15
    protected $class;
16
17
    /**
18
     * @var string
19
     */
20
    protected $id;
21
22
    /**
23
     * @var string
24
     */
25
    protected $route;
26
27
    /**
28
     * @var string
29
     */
30
    protected $title;
31
32
    /**
33
     * @var int
34
     */
35
    protected $weight;
36
37
    /**
38
     * @param string $class
39
     * @param mixed $id
40
     * @param string $bundle
41
     * @param string $title
42
     * @param string $route
43
     */
44 4
    public function __construct($class, $id, $bundle, $title, $route)
45
    {
46 4
        $this->setClass($class);
47 4
        $this->setId($id);
48 4
        $this->setBundle($bundle);
49 4
        $this->setTitle($title);
50 4
        $this->setRoute($route);
51 4
    }
52
53
    /**
54
     * @param string $bundle
55
     */
56 4
    protected function setBundle($bundle)
57
    {
58 4
        $this->bundle = $bundle;
59 4
    }
60
61
    /**
62
     * @return string
63
     */
64 1
    public function getBundle()
65
    {
66 1
        return $this->bundle;
67
    }
68
69
    /**
70
     * @param string $class
71
     */
72 4
    protected function setClass($class)
73
    {
74 4
        $this->class = $class;
75 4
    }
76
77
    /**
78
     * @return string
79
     */
80 4
    public function getClass()
81
    {
82 4
        return $this->class;
83
    }
84
85
    /**
86
     * @param mixed $id
87
     */
88 4
    protected function setId($id)
89
    {
90 4
        $this->id = (string) $id;
91 4
    }
92
93
    /**
94
     * @return string
95
     */
96 4
    public function getId()
97
    {
98 4
        return $this->id;
99
    }
100
101
    /**
102
     * @param string $route
103
     */
104 4
    protected function setRoute($route)
105
    {
106 4
        $this->route = $route;
107 4
    }
108
109
    /**
110
     * @return string
111
     */
112 1
    public function getRoute()
113
    {
114 1
        return $this->route;
115
    }
116
117
    /**
118
     * @param string $title
119
     */
120 4
    protected function setTitle($title)
121
    {
122 4
        $this->title = $title;
123 4
    }
124
125
    /**
126
     * @return string
127
     */
128 2
    public function getTitle()
129
    {
130 2
        return $this->title;
131
    }
132
133
    /**
134
     * @param int $weight
135
     */
136 4
    public function setWeight($weight)
137
    {
138 4
        $this->weight = $weight;
139 4
    }
140
141
    /**
142
     * @return int
143
     */
144 4
    public function getWeight()
145
    {
146 4
        return $this->weight;
147
    }
148
}
149