Block   A
last analyzed

Complexity

Total Complexity 17

Size/Duplication

Total Lines 229
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 17
lcom 0
cbo 0
dl 0
loc 229
rs 10
c 0
b 0
f 0

17 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __set() 0 4 1
A __toString() 0 4 1
A getId() 0 4 1
A setId() 0 6 1
A getContent() 0 4 1
A setContent() 0 6 1
A getDateCreated() 0 4 1
A setDateCreated() 0 6 1
A getDateUpdated() 0 4 1
A setDateUpdated() 0 6 1
A getName() 0 4 1
A setName() 0 6 1
A getSlug() 0 4 1
A setSlug() 0 6 1
A getLocale() 0 4 1
A setLocale() 0 4 1
1
<?php
2
3
namespace Alpixel\Bundle\CMSBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Mapping\Annotation as Gedmo;
7
8
/**
9
 * Block.
10
 *
11
 * @ORM\Table(name="cms_block")
12
 * @ORM\HasLifecycleCallbacks
13
 * @ORM\Entity(repositoryClass="Alpixel\Bundle\CMSBundle\Entity\Repository\BlockRepository")
14
 * @ORM\InheritanceType("JOINED")
15
 * @ORM\DiscriminatorColumn(name="type", type="string")
16
 * @ORM\DiscriminatorMap({"block" = "Alpixel\Bundle\CMSBundle\Entity\Block"})
17
 */
18
class Block
19
{
20
    /**
21
     * @var int
22
     *
23
     * @ORM\Column(name="block_id", type="integer")
24
     * @ORM\Id
25
     * @ORM\GeneratedValue(strategy="AUTO")
26
     */
27
    protected $id;
28
29
    /**
30
     * @var string
31
     *
32
     * @ORM\Column(name="locale", type="string", length=10, nullable=true)
33
     */
34
    protected $locale;
35
36
    /**
37
     * @var string
38
     *
39
     * @ORM\Column(name="slug", type="string", length=255, nullable=false)
40
     */
41
    protected $slug;
42
43
    /**
44
     * @var string
45
     *
46
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
47
     */
48
    protected $name;
49
50
    /**
51
     * @var string
52
     *
53
     * @ORM\Column(name="content", type="text", nullable=true)
54
     */
55
    protected $content;
56
57
    /**
58
     * @var \DateTime
59
     *
60
     * @Gedmo\Timestampable(on="create")
61
     * @ORM\Column(name="date_created", type="datetime", nullable=false)
62
     */
63
    protected $dateCreated;
64
65
    /**
66
     * @var \DateTime
67
     *
68
     * @Gedmo\Timestampable(on="update")
69
     * @ORM\Column(name="date_updated", type="datetime", nullable=false)
70
     */
71
    protected $dateUpdated;
72
73
    public function __construct()
74
    {
75
    }
76
77
    public function __set($name, $value)
78
    {
79
        $this->{$name} = $value;
80
    }
81
82
    public function __toString()
83
    {
84
        return $this->name;
85
    }
86
87
    /**
88
     * Gets the value of id.
89
     *
90
     * @return int
91
     */
92
    public function getId()
93
    {
94
        return $this->id;
95
    }
96
97
    /**
98
     * Sets the value of id.
99
     *
100
     * @param int $id the id
101
     *
102
     * @return self
103
     */
104
    public function setId($id)
105
    {
106
        $this->id = $id;
107
108
        return $this;
109
    }
110
111
    /**
112
     * Gets the value of content.
113
     *
114
     * @return string
115
     */
116
    public function getContent()
117
    {
118
        return $this->content;
119
    }
120
121
    /**
122
     * Sets the value of content.
123
     *
124
     * @param string $content the content
125
     *
126
     * @return self
127
     */
128
    public function setContent($content)
129
    {
130
        $this->content = $content;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Gets the value of dateCreated.
137
     *
138
     * @return \DateTime
139
     */
140
    public function getDateCreated()
141
    {
142
        return $this->dateCreated;
143
    }
144
145
    /**
146
     * Sets the value of dateCreated.
147
     *
148
     * @param \DateTime $dateCreated the date created
149
     *
150
     * @return self
151
     */
152
    public function setDateCreated(\DateTime $dateCreated)
153
    {
154
        $this->dateCreated = $dateCreated;
155
156
        return $this;
157
    }
158
159
    /**
160
     * Gets the value of dateUpdated.
161
     *
162
     * @return \DateTime
163
     */
164
    public function getDateUpdated()
165
    {
166
        return $this->dateUpdated;
167
    }
168
169
    /**
170
     * Sets the value of dateUpdated.
171
     *
172
     * @param \DateTime $dateUpdated the date updated
173
     *
174
     * @return self
175
     */
176
    public function setDateUpdated(\DateTime $dateUpdated)
177
    {
178
        $this->dateUpdated = $dateUpdated;
179
180
        return $this;
181
    }
182
183
    /**
184
     * Gets the value of name.
185
     *
186
     * @return string
187
     */
188
    public function getName()
189
    {
190
        return $this->name;
191
    }
192
193
    /**
194
     * Sets the value of name.
195
     *
196
     * @param string $name the name
197
     *
198
     * @return self
199
     */
200
    public function setName($name)
201
    {
202
        $this->name = $name;
203
204
        return $this;
205
    }
206
207
    /**
208
     * Gets the value of slug.
209
     *
210
     * @return string
211
     */
212
    public function getSlug()
213
    {
214
        return $this->slug;
215
    }
216
217
    /**
218
     * Sets the value of slug.
219
     *
220
     * @param string $slug the slug
221
     *
222
     * @return self
223
     */
224
    public function setSlug($slug)
225
    {
226
        $this->slug = $slug;
227
228
        return $this;
229
    }
230
231
    /**
232
     * @return string
233
     */
234
    public function getLocale()
235
    {
236
        return $this->locale;
237
    }
238
239
    /**
240
     * @param string $locale
241
     */
242
    public function setLocale($locale)
243
    {
244
        $this->locale = $locale;
245
    }
246
}
247