1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AppBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
6
|
|
|
use Doctrine\ORM\Mapping as ORM; |
7
|
|
|
use Doctrine\ORM\Mapping\OneToMany; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* PageGroup |
11
|
|
|
* |
12
|
|
|
* @ORM\Table(name="page_groups") |
13
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\PageRepository") |
14
|
|
|
*/ |
15
|
|
View Code Duplication |
class PageGroup |
|
|
|
|
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 string |
28
|
|
|
* |
29
|
|
|
* @ORM\Column(name="slug", type="string", length=255, unique=true) |
30
|
|
|
*/ |
31
|
|
|
private $slug; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
* |
36
|
|
|
* @ORM\Column(name="meta_keywords", type="string", length=255, nullable=true) |
37
|
|
|
*/ |
38
|
|
|
private $metaKeywords; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var string |
42
|
|
|
* |
43
|
|
|
* @ORM\Column(name="meta_description", type="string", length=255, nullable=true) |
44
|
|
|
*/ |
45
|
|
|
private $metaDescription; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
* |
50
|
|
|
* @ORM\Column(name="meta_social", type="text", nullable=true) |
51
|
|
|
*/ |
52
|
|
|
private $metaSocial; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var \DateTime |
56
|
|
|
* |
57
|
|
|
* @ORM\Column(name="updated_at", type="datetime") |
58
|
|
|
*/ |
59
|
|
|
private $updatedAt; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var bool |
63
|
|
|
* |
64
|
|
|
* @ORM\Column(name="active", type="boolean", nullable=false ) |
65
|
|
|
*/ |
66
|
|
|
private $active = true; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* One PageGroup has many PageBlocks. |
70
|
|
|
* |
71
|
|
|
* @var ArrayCollection |
|
|
|
|
72
|
|
|
* |
73
|
|
|
* @OneToMany(targetEntity="PageBlock", mappedBy="pageGroup") |
74
|
|
|
*/ |
75
|
|
|
private $pageBlocks; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* PageGroup constructor. |
79
|
|
|
*/ |
80
|
|
|
public function __construct() |
81
|
|
|
{ |
82
|
|
|
$this->pageBlocks = new ArrayCollection(); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Get id |
87
|
|
|
* |
88
|
|
|
* @return int |
89
|
|
|
*/ |
90
|
|
|
public function getId() |
91
|
|
|
{ |
92
|
|
|
return $this->id; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* Set slug |
97
|
|
|
* |
98
|
|
|
* @param string $slug |
99
|
|
|
* |
100
|
|
|
* @return PageGroup |
|
|
|
|
101
|
|
|
*/ |
102
|
|
|
public function setSlug($slug) |
103
|
|
|
{ |
104
|
|
|
$this->slug = $slug; |
105
|
|
|
|
106
|
|
|
return $this; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* Get slug |
111
|
|
|
* |
112
|
|
|
* @return string |
113
|
|
|
*/ |
114
|
|
|
public function getSlug() |
115
|
|
|
{ |
116
|
|
|
return $this->slug; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* Set metaKeywords |
121
|
|
|
* |
122
|
|
|
* @param string $metaKeywords |
123
|
|
|
* |
124
|
|
|
* @return PageGroup |
|
|
|
|
125
|
|
|
*/ |
126
|
|
|
public function setMetaKeywords($metaKeywords) |
127
|
|
|
{ |
128
|
|
|
$this->metaKeywords = $metaKeywords; |
129
|
|
|
|
130
|
|
|
return $this; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* Get metaKeywords |
135
|
|
|
* |
136
|
|
|
* @return string |
137
|
|
|
*/ |
138
|
|
|
public function getMetaKeywords() |
139
|
|
|
{ |
140
|
|
|
return $this->metaKeywords; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Set metaDescription |
145
|
|
|
* |
146
|
|
|
* @param string $metaDescription |
147
|
|
|
* |
148
|
|
|
* @return PageGroup |
|
|
|
|
149
|
|
|
*/ |
150
|
|
|
public function setMetaDescription($metaDescription) |
151
|
|
|
{ |
152
|
|
|
$this->metaDescription = $metaDescription; |
153
|
|
|
|
154
|
|
|
return $this; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* Get metaDescription |
159
|
|
|
* |
160
|
|
|
* @return string |
161
|
|
|
*/ |
162
|
|
|
public function getMetaDescription() |
163
|
|
|
{ |
164
|
|
|
return $this->metaDescription; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* Set metaSocial |
169
|
|
|
* |
170
|
|
|
* @param string $metaSocial |
171
|
|
|
* |
172
|
|
|
* @return PageGroup |
|
|
|
|
173
|
|
|
*/ |
174
|
|
|
public function setMetaSocial($metaSocial) |
175
|
|
|
{ |
176
|
|
|
$this->metaSocial = $metaSocial; |
177
|
|
|
|
178
|
|
|
return $this; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* Get metaSocial |
183
|
|
|
* |
184
|
|
|
* @return string |
185
|
|
|
*/ |
186
|
|
|
public function getMetaSocial() |
187
|
|
|
{ |
188
|
|
|
return $this->metaSocial; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* Set lastChanged |
193
|
|
|
* |
194
|
|
|
* @param \DateTime $updatedAt |
195
|
|
|
* |
196
|
|
|
* @return PageGroup |
|
|
|
|
197
|
|
|
*/ |
198
|
|
|
public function setUpdatedAt($updatedAt) |
|
|
|
|
199
|
|
|
{ |
200
|
|
|
$this->updatedAt = $updatedAt; |
201
|
|
|
|
202
|
|
|
return $this; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* Get lastChanged |
207
|
|
|
* |
208
|
|
|
* @return \DateTime |
209
|
|
|
*/ |
210
|
|
|
public function getUpdatedAt() |
211
|
|
|
{ |
212
|
|
|
return $this->updatedAt; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* Set active |
217
|
|
|
* |
218
|
|
|
* @param boolean $active |
|
|
|
|
219
|
|
|
* |
220
|
|
|
* @return PageGroup |
|
|
|
|
221
|
|
|
*/ |
222
|
|
|
public function setActive($active) |
223
|
|
|
{ |
224
|
|
|
$this->active = $active; |
225
|
|
|
|
226
|
|
|
return $this; |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* Get active |
231
|
|
|
* |
232
|
|
|
* @return bool |
233
|
|
|
*/ |
234
|
|
|
public function getActive() |
235
|
|
|
{ |
236
|
|
|
return $this->active; |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* @return ArrayCollection |
|
|
|
|
241
|
|
|
*/ |
242
|
|
|
public function getPageBlocks() |
243
|
|
|
{ |
244
|
|
|
return $this->pageBlocks; |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* @param ArrayCollection $pageBlocks |
|
|
|
|
249
|
|
|
* |
250
|
|
|
* @return void |
251
|
|
|
*/ |
252
|
|
|
public function setPageBlocks(ArrayCollection $pageBlocks) |
253
|
|
|
{ |
254
|
|
|
$this->pageBlocks = $pageBlocks; |
255
|
|
|
} |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
|
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.