Completed
Pull Request — master (#19)
by Benjamin
06:09
created

Block::preUpdate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
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="slug", type="string", length=255, nullable=false)
33
     */
34
    protected $slug;
35
36
    /**
37
     * @var string
38
     *
39
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
40
     */
41
    protected $name;
42
43
    /**
44
     * @var string
45
     *
46
     * @ORM\Column(name="content", type="text", nullable=true)
47
     */
48
    protected $content;
49
50
    /**
51
     * @var \DateTime
52
     *
53
     * @Gedmo\Timestampable(on="create")
54
     * @ORM\Column(name="date_created", type="datetime", nullable=false)
55
     */
56
    protected $dateCreated;
57
58
    /**
59
     * @var \DateTime
60
     *
61
     * @Gedmo\Timestampable(on="update")
62
     * @ORM\Column(name="date_updated", type="datetime", nullable=false)
63
     */
64
    protected $dateUpdated;
65
66
    public function __construct()
67
    {
68
    }
69
70
    public function __toString()
71
    {
72
        return $this->name;
73
    }
74
75
    /**
76
     * Gets the value of id.
77
     *
78
     * @return int
79
     */
80
    public function getId()
81
    {
82
        return $this->id;
83
    }
84
85
    /**
86
     * Sets the value of id.
87
     *
88
     * @param int $id the id
89
     *
90
     * @return self
91
     */
92
    public function setId($id)
93
    {
94
        $this->id = $id;
95
96
        return $this;
97
    }
98
99
    /**
100
     * Gets the value of content.
101
     *
102
     * @return string
103
     */
104
    public function getContent()
105
    {
106
        return $this->content;
107
    }
108
109
    /**
110
     * Sets the value of content.
111
     *
112
     * @param string $content the content
113
     *
114
     * @return self
115
     */
116
    public function setContent($content)
117
    {
118
        $this->content = $content;
119
120
        return $this;
121
    }
122
123
    /**
124
     * Gets the value of dateCreated.
125
     *
126
     * @return \DateTime
127
     */
128
    public function getDateCreated()
129
    {
130
        return $this->dateCreated;
131
    }
132
133
    /**
134
     * Sets the value of dateCreated.
135
     *
136
     * @param \DateTime $dateCreated the date created
137
     *
138
     * @return self
139
     */
140
    public function setDateCreated(\DateTime $dateCreated)
141
    {
142
        $this->dateCreated = $dateCreated;
143
144
        return $this;
145
    }
146
147
    /**
148
     * Gets the value of dateUpdated.
149
     *
150
     * @return \DateTime
151
     */
152
    public function getDateUpdated()
153
    {
154
        return $this->dateUpdated;
155
    }
156
157
    /**
158
     * Sets the value of dateUpdated.
159
     *
160
     * @param \DateTime $dateUpdated the date updated
161
     *
162
     * @return self
163
     */
164
    public function setDateUpdated(\DateTime $dateUpdated)
165
    {
166
        $this->dateUpdated = $dateUpdated;
167
168
        return $this;
169
    }
170
171
    /**
172
     * Gets the value of name.
173
     *
174
     * @return string
175
     */
176
    public function getName()
177
    {
178
        return $this->name;
179
    }
180
181
    /**
182
     * Sets the value of name.
183
     *
184
     * @param string $name the name
185
     *
186
     * @return self
187
     */
188
    public function setName($name)
189
    {
190
        $this->name = $name;
191
192
        return $this;
193
    }
194
195
    /**
196
     * Gets the value of slug.
197
     *
198
     * @return string
199
     */
200
    public function getSlug()
201
    {
202
        return $this->slug;
203
    }
204
205
    /**
206
     * Sets the value of slug.
207
     *
208
     * @param string $slug the slug
209
     *
210
     * @return self
211
     */
212
    public function setSlug($slug)
213
    {
214
        $this->slug = $slug;
215
216
        return $this;
217
    }
218
}
219