1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AppBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Doctrine\ORM\Mapping\JoinColumn; |
7
|
|
|
use Doctrine\ORM\Mapping\ManyToOne; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* PageBlock |
11
|
|
|
* |
12
|
|
|
* @ORM\Table(name="page_blocks") |
13
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\PageRepository") |
14
|
|
|
*/ |
15
|
|
View Code Duplication |
class PageBlock |
|
|
|
|
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* @var int |
19
|
|
|
* |
20
|
|
|
* @ORM\Column(name="id", type="integer") |
21
|
|
|
* @ORM\Id |
22
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
23
|
|
|
*/ |
24
|
|
|
private $id; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var int |
28
|
|
|
* |
29
|
|
|
* @ORM\Column(name="page_group_id", type="integer") |
30
|
|
|
*/ |
31
|
|
|
private $pageGroupId; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
* |
36
|
|
|
* @ORM\Column(name="title", type="string", length=255) |
37
|
|
|
*/ |
38
|
|
|
private $title; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var string |
42
|
|
|
* |
43
|
|
|
* @ORM\Column(name="html", type="text") |
44
|
|
|
*/ |
45
|
|
|
private $html; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var int |
49
|
|
|
* |
50
|
|
|
* @ORM\Column(name="position", type="integer") |
51
|
|
|
*/ |
52
|
|
|
private $position; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var \DateTime |
56
|
|
|
* |
57
|
|
|
* @ORM\Column(name="updated_at", type="datetime") |
58
|
|
|
*/ |
59
|
|
|
private $updatedAt; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var int |
63
|
|
|
* |
64
|
|
|
* @ORM\Column(name="active", type="integer") |
65
|
|
|
*/ |
66
|
|
|
private $active; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Many PageBlocks have one PageGroup. |
70
|
|
|
* |
71
|
|
|
* @var integer PageGroup |
72
|
|
|
* |
73
|
|
|
* @ManyToOne(targetEntity="PageGroup", inversedBy="pageBlocks") |
74
|
|
|
* @JoinColumn(name="page_group_id", referencedColumnName="id") |
75
|
|
|
*/ |
76
|
|
|
private $pageGroup; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Get id |
80
|
|
|
* |
81
|
|
|
* @return int |
82
|
|
|
*/ |
83
|
|
|
public function getId() |
84
|
|
|
{ |
85
|
|
|
return $this->id; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Set pageGroupId |
90
|
|
|
* |
91
|
|
|
* @param integer $pageGroupId |
|
|
|
|
92
|
|
|
* |
93
|
|
|
* @return PageBlock |
|
|
|
|
94
|
|
|
*/ |
95
|
|
|
public function setPageGroupId($pageGroupId) |
96
|
|
|
{ |
97
|
|
|
$this->pageGroupId = $pageGroupId; |
98
|
|
|
|
99
|
|
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* Get pageGroupId |
104
|
|
|
* |
105
|
|
|
* @return int |
106
|
|
|
*/ |
107
|
|
|
public function getPageGroupId() |
108
|
|
|
{ |
109
|
|
|
return $this->pageGroupId; |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* Set title |
114
|
|
|
* |
115
|
|
|
* @param string $title |
116
|
|
|
* |
117
|
|
|
* @return PageBlock |
|
|
|
|
118
|
|
|
*/ |
119
|
|
|
public function setTitle($title) |
120
|
|
|
{ |
121
|
|
|
$this->title = $title; |
122
|
|
|
|
123
|
|
|
return $this; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* Get title |
128
|
|
|
* |
129
|
|
|
* @return string |
130
|
|
|
*/ |
131
|
|
|
public function getTitle() |
132
|
|
|
{ |
133
|
|
|
return $this->title; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Set html |
138
|
|
|
* |
139
|
|
|
* @param string $html |
140
|
|
|
* |
141
|
|
|
* @return PageBlock |
|
|
|
|
142
|
|
|
*/ |
143
|
|
|
public function setHtml($html) |
144
|
|
|
{ |
145
|
|
|
$this->html = $html; |
146
|
|
|
|
147
|
|
|
return $this; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* Get html |
152
|
|
|
* |
153
|
|
|
* @return string |
154
|
|
|
*/ |
155
|
|
|
public function getHtml() |
156
|
|
|
{ |
157
|
|
|
return $this->html; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Set position |
162
|
|
|
* |
163
|
|
|
* @param integer $position |
|
|
|
|
164
|
|
|
* |
165
|
|
|
* @return PageBlock |
|
|
|
|
166
|
|
|
*/ |
167
|
|
|
public function setPosition($position) |
168
|
|
|
{ |
169
|
|
|
$this->position = $position; |
170
|
|
|
|
171
|
|
|
return $this; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* Get position |
176
|
|
|
* |
177
|
|
|
* @return int |
178
|
|
|
*/ |
179
|
|
|
public function getPosition() |
180
|
|
|
{ |
181
|
|
|
return $this->position; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* Set lastChanged |
186
|
|
|
* |
187
|
|
|
* @param \DateTime $updatedAt |
188
|
|
|
* |
189
|
|
|
* @return PageBlock |
|
|
|
|
190
|
|
|
*/ |
191
|
|
|
public function setUpdatedAt($updatedAt) |
|
|
|
|
192
|
|
|
{ |
193
|
|
|
$this->updatedAt = $updatedAt; |
194
|
|
|
|
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* Get lastChanged |
200
|
|
|
* |
201
|
|
|
* @return \DateTime |
202
|
|
|
*/ |
203
|
|
|
public function getUpdatedAt() |
204
|
|
|
{ |
205
|
|
|
return $this->updatedAt; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* Set active |
210
|
|
|
* |
211
|
|
|
* @param integer $active |
|
|
|
|
212
|
|
|
* |
213
|
|
|
* @return PageBlock |
|
|
|
|
214
|
|
|
*/ |
215
|
|
|
public function setActive($active) |
216
|
|
|
{ |
217
|
|
|
$this->active = $active; |
218
|
|
|
|
219
|
|
|
return $this; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* Get active |
224
|
|
|
* |
225
|
|
|
* @return int |
226
|
|
|
*/ |
227
|
|
|
public function getActive() |
228
|
|
|
{ |
229
|
|
|
return $this->active; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* @return PageGroup |
|
|
|
|
234
|
|
|
*/ |
235
|
|
|
public function getPageGroup() |
236
|
|
|
{ |
237
|
|
|
return $this->pageGroup; |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* @param PageGroup $pageGroup |
|
|
|
|
242
|
|
|
* |
243
|
|
|
* @return void |
244
|
|
|
*/ |
245
|
|
|
public function setPageGroup(PageGroup $pageGroup) |
246
|
|
|
{ |
247
|
|
|
$this->pageGroup = $pageGroup; |
|
|
|
|
248
|
|
|
} |
249
|
|
|
} |
250
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.