diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-06 07:45:32 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-06 07:45:32 +0100 |
commit | be463487cc195026b11e92f1d6d6276f5851b97e (patch) | |
tree | 5d5bd15db7ae19994da55574ade821acdc115c36 /src/Wallabag/CoreBundle/Entity | |
parent | 905ae369bd0238cc24c3c4e0ac60d578d30b54bb (diff) | |
download | wallabag-be463487cc195026b11e92f1d6d6276f5851b97e.tar.gz wallabag-be463487cc195026b11e92f1d6d6276f5851b97e.tar.zst wallabag-be463487cc195026b11e92f1d6d6276f5851b97e.zip |
rename Entries to Entry
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php (renamed from src/Wallabag/CoreBundle/Entity/Entries.php) | 63 |
1 files changed, 29 insertions, 34 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entries.php b/src/Wallabag/CoreBundle/Entity/Entry.php index f06a2940..70c1dc08 100644 --- a/src/Wallabag/CoreBundle/Entity/Entries.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -6,23 +6,23 @@ use Doctrine\ORM\Mapping as ORM; | |||
6 | use Symfony\Component\Validator\Constraints as Assert; | 6 | use Symfony\Component\Validator\Constraints as Assert; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * Entries | 9 | * Entry |
10 | * | 10 | * |
11 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntriesRepository") | 11 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository") |
12 | * @ORM\Table(name="entries") | 12 | * @ORM\Table(name="entry") |
13 | * @ORM\HasLifecycleCallbacks() | 13 | * @ORM\HasLifecycleCallbacks() |
14 | * | 14 | * |
15 | */ | 15 | */ |
16 | class Entries | 16 | class Entry |
17 | { | 17 | { |
18 | /** | 18 | /** |
19 | * @var integer | 19 | * @var integer |
20 | * | 20 | * |
21 | * @ORM\Column(name="id", type="integer", nullable=true) | 21 | * @ORM\Column(name="id", type="integer") |
22 | * @ORM\Id | 22 | * @ORM\Id |
23 | * @ORM\GeneratedValue(strategy="AUTO") | 23 | * @ORM\GeneratedValue(strategy="AUTO") |
24 | */ | 24 | */ |
25 | private $id = null; | 25 | private $id; |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * @var string | 28 | * @var string |
@@ -42,21 +42,21 @@ class Entries | |||
42 | /** | 42 | /** |
43 | * @var boolean | 43 | * @var boolean |
44 | * | 44 | * |
45 | * @ORM\Column(name="is_archived", type="boolean", nullable=true, options={"default" = false}) | 45 | * @ORM\Column(name="is_archived", type="boolean") |
46 | */ | 46 | */ |
47 | private $isArchived = false; | 47 | private $isArchived = false; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * @var boolean | 50 | * @var boolean |
51 | * | 51 | * |
52 | * @ORM\Column(name="is_starred", type="boolean", nullable=true, options={"default" = false}) | 52 | * @ORM\Column(name="is_starred", type="boolean") |
53 | */ | 53 | */ |
54 | private $isStarred = false; | 54 | private $isStarred = false; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * @var boolean | 57 | * @var boolean |
58 | * | 58 | * |
59 | * @ORM\Column(name="is_deleted", type="boolean", nullable=true, options={"default" = false}) | 59 | * @ORM\Column(name="is_deleted", type="boolean") |
60 | */ | 60 | */ |
61 | private $isDeleted = false; | 61 | private $isDeleted = false; |
62 | 62 | ||
@@ -70,14 +70,14 @@ class Entries | |||
70 | /** | 70 | /** |
71 | * @var date | 71 | * @var date |
72 | * | 72 | * |
73 | * @ORM\Column(name="created_at", type="datetime", nullable=true) | 73 | * @ORM\Column(name="created_at", type="datetime") |
74 | */ | 74 | */ |
75 | private $createdAt; | 75 | private $createdAt; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * @var date | 78 | * @var date |
79 | * | 79 | * |
80 | * @ORM\Column(name="updated_at", type="datetime", nullable=true) | 80 | * @ORM\Column(name="updated_at", type="datetime") |
81 | */ | 81 | */ |
82 | private $updatedAt; | 82 | private $updatedAt; |
83 | 83 | ||
@@ -136,8 +136,8 @@ class Entries | |||
136 | /** | 136 | /** |
137 | * Set title | 137 | * Set title |
138 | * | 138 | * |
139 | * @param string $title | 139 | * @param string $title |
140 | * @return Entries | 140 | * @return Entry |
141 | */ | 141 | */ |
142 | public function setTitle($title) | 142 | public function setTitle($title) |
143 | { | 143 | { |
@@ -159,8 +159,8 @@ class Entries | |||
159 | /** | 159 | /** |
160 | * Set url | 160 | * Set url |
161 | * | 161 | * |
162 | * @param string $url | 162 | * @param string $url |
163 | * @return Entries | 163 | * @return Entry |
164 | */ | 164 | */ |
165 | public function setUrl($url) | 165 | public function setUrl($url) |
166 | { | 166 | { |
@@ -182,8 +182,8 @@ class Entries | |||
182 | /** | 182 | /** |
183 | * Set isArchived | 183 | * Set isArchived |
184 | * | 184 | * |
185 | * @param string $isArchived | 185 | * @param string $isArchived |
186 | * @return Entries | 186 | * @return Entry |
187 | */ | 187 | */ |
188 | public function setArchived($isArchived) | 188 | public function setArchived($isArchived) |
189 | { | 189 | { |
@@ -212,8 +212,8 @@ class Entries | |||
212 | /** | 212 | /** |
213 | * Set isStarred | 213 | * Set isStarred |
214 | * | 214 | * |
215 | * @param string $isStarred | 215 | * @param string $isStarred |
216 | * @return Entries | 216 | * @return Entry |
217 | */ | 217 | */ |
218 | public function setStarred($isStarred) | 218 | public function setStarred($isStarred) |
219 | { | 219 | { |
@@ -242,8 +242,8 @@ class Entries | |||
242 | /** | 242 | /** |
243 | * Set content | 243 | * Set content |
244 | * | 244 | * |
245 | * @param string $content | 245 | * @param string $content |
246 | * @return Entries | 246 | * @return Entry |
247 | */ | 247 | */ |
248 | public function setContent($content) | 248 | public function setContent($content) |
249 | { | 249 | { |
@@ -265,8 +265,8 @@ class Entries | |||
265 | /** | 265 | /** |
266 | * Set userId | 266 | * Set userId |
267 | * | 267 | * |
268 | * @param string $userId | 268 | * @param string $userId |
269 | * @return Entries | 269 | * @return Entry |
270 | */ | 270 | */ |
271 | public function setUserId($userId) | 271 | public function setUserId($userId) |
272 | { | 272 | { |
@@ -310,15 +310,6 @@ class Entries | |||
310 | } | 310 | } |
311 | 311 | ||
312 | /** | 312 | /** |
313 | * @param mixed $createdAt | ||
314 | * @ORM\PrePersist | ||
315 | */ | ||
316 | public function setCreatedAt() | ||
317 | { | ||
318 | $this->createdAt = new \DateTime(); | ||
319 | } | ||
320 | |||
321 | /** | ||
322 | * @return string | 313 | * @return string |
323 | */ | 314 | */ |
324 | public function getUpdatedAt() | 315 | public function getUpdatedAt() |
@@ -327,11 +318,15 @@ class Entries | |||
327 | } | 318 | } |
328 | 319 | ||
329 | /** | 320 | /** |
330 | * @param string $updatedAt | 321 | * @ORM\PrePersist |
331 | * @ORM\PreUpdate | 322 | * @ORM\PreUpdate |
332 | */ | 323 | */ |
333 | public function setUpdatedAt() | 324 | public function timestamps() |
334 | { | 325 | { |
326 | if (is_null($this->createdAt)) { | ||
327 | $this->createdAt = new \DateTime(); | ||
328 | } | ||
329 | |||
335 | $this->updatedAt = new \DateTime(); | 330 | $this->updatedAt = new \DateTime(); |
336 | } | 331 | } |
337 | 332 | ||