Completed
Push — master ( a9d3b9...e09e3d )
by Kirill
03:27
created

Widget::setX()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity
9
 * @ORM\Table(name="widgets")
10
 */
11
class Widget
12
{
13
14
    /**
15
     * @ORM\Column(type="integer")
16
     * @ORM\Id
17
     * @ORM\GeneratedValue(strategy="AUTO")
18
     */
19
    private $id;
20
21
    /**
22
     * @ORM\Column(type="string", length=100)
23
     */
24
    private $name;
25
26
    /**
27
     * @return mixed
28
     */
29
    public function getType()
30
    {
31
        return $this->type;
32
    }
33
34
    /**
35
     * @param mixed $type
36
     * @return Widget
37
     */
38
    public function setType($type)
39
    {
40
        $this->type = $type;
41
        return $this;
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47
    public function getWidth()
48
    {
49
        return $this->width;
50
    }
51
52
    /**
53
     * @param mixed $width
54
     * @return Widget
55
     */
56
    public function setWidth($width)
57
    {
58
        $this->width = $width;
59
        return $this;
60
    }
61
62
    /**
63
     * @return mixed
64
     */
65
    public function getHeight()
66
    {
67
        return $this->height;
68
    }
69
70
    /**
71
     * @param mixed $height
72
     * @return Widget
73
     */
74
    public function setHeight($height)
75
    {
76
        $this->height = $height;
77
        return $this;
78
    }
79
80
    /**
81
     * @return mixed
82
     */
83
    public function getX()
84
    {
85
        return $this->x;
86
    }
87
88
    /**
89
     * @param mixed $x
90
     * @return Widget
91
     */
92
    public function setX($x)
93
    {
94
        $this->x = $x;
95
        return $this;
96
    }
97
98
    /**
99
     * @return mixed
100
     */
101
    public function getY()
102
    {
103
        return $this->y;
104
    }
105
106
    /**
107
     * @param mixed $y
108
     * @return Widget
109
     */
110
    public function setY($y)
111
    {
112
        $this->y = $y;
113
        return $this;
114
    }
115
    /**
116
     * @ORM\Column(type="string", length=10)
117
     */
118
    private $type;
119
120
    /**
121
     * @ORM\Column(type="integer", options={"default" : 2})
122
     */
123
    private $width = 2;
124
    /**
125
     * @ORM\Column(type="integer", options={"default" : 1})
126
     */
127
    private $height = 1;
128
    /**
129
     * @ORM\Column(type="integer")
130
     */
131
    private $x;
132
    /**
133
     * @ORM\Column(type="integer")
134
     */
135
    private $y;
136
137
    /**
138
     * @ORM\ManyToOne(inversedBy="widgets",targetEntity="AppBundle\Entity\Variable")
139
     */
140
    private $variable;
141
142
    /**
143
     * @return Variable
144
     */
145
    public function getVariable()
146
    {
147
        return $this->variable;
148
    }
149
150
    /**
151
     * @param mixed $variable
152
     * @return Widget
153
     */
154
    public function setVariable($variable)
155
    {
156
        $this->variable = $variable;
157
        return $this;
158
    }
159
160
    /**
161
     * @return mixed
162
     */
163
    public function getId()
164
    {
165
        return $this->id;
166
    }
167
168
    /**
169
     * @param mixed $id
170
     * @return Device
171
     */
172
    public function setId($id)
173
    {
174
        $this->id = $id;
175
        return $this;
176
    }
177
178
    /**
179
     * @return mixed
180
     */
181
    public function getName()
182
    {
183
        return $this->name;
184
    }
185
186
    /**
187
     * @param mixed $name
188
     * @return Device
189
     */
190
    public function setName($name)
191
    {
192
        $this->name = $name;
193
        return $this;
194
    }
195
196
    public function __toString()
197
    {
198
        return $this->getName();
199
    }
200
}
201