diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-10-23 11:09:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 11:09:17 +0200 |
commit | 1953a872932a63792293b4aec087880265ba89f7 (patch) | |
tree | fd16599e737fcdaf193c933ef3ec4a4ee248b117 /src/Wallabag/AnnotationBundle/Entity/Annotation.php | |
parent | d83d25dadec2c38460a32d96f5d2903426fec9d3 (diff) | |
parent | 702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff) | |
download | wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.gz wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.zst wallabag-1953a872932a63792293b4aec087880265ba89f7.zip |
Merge pull request #3011 from wallabag/2.3
wallabag 2.3.0
Diffstat (limited to 'src/Wallabag/AnnotationBundle/Entity/Annotation.php')
-rw-r--r-- | src/Wallabag/AnnotationBundle/Entity/Annotation.php | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/Wallabag/AnnotationBundle/Entity/Annotation.php b/src/Wallabag/AnnotationBundle/Entity/Annotation.php index 0838f5aa..a180d504 100644 --- a/src/Wallabag/AnnotationBundle/Entity/Annotation.php +++ b/src/Wallabag/AnnotationBundle/Entity/Annotation.php | |||
@@ -3,13 +3,15 @@ | |||
3 | namespace Wallabag\AnnotationBundle\Entity; | 3 | namespace Wallabag\AnnotationBundle\Entity; |
4 | 4 | ||
5 | use Doctrine\ORM\Mapping as ORM; | 5 | use Doctrine\ORM\Mapping as ORM; |
6 | use JMS\Serializer\Annotation\ExclusionPolicy; | ||
7 | use JMS\Serializer\Annotation\Exclude; | 6 | use JMS\Serializer\Annotation\Exclude; |
8 | use JMS\Serializer\Annotation\VirtualProperty; | 7 | use JMS\Serializer\Annotation\ExclusionPolicy; |
9 | use JMS\Serializer\Annotation\SerializedName; | ||
10 | use JMS\Serializer\Annotation\Groups; | 8 | use JMS\Serializer\Annotation\Groups; |
11 | use Wallabag\UserBundle\Entity\User; | 9 | use JMS\Serializer\Annotation\SerializedName; |
10 | use JMS\Serializer\Annotation\VirtualProperty; | ||
11 | use Symfony\Component\Validator\Constraints as Assert; | ||
12 | use Wallabag\CoreBundle\Entity\Entry; | 12 | use Wallabag\CoreBundle\Entity\Entry; |
13 | use Wallabag\CoreBundle\Helper\EntityTimestampsTrait; | ||
14 | use Wallabag\UserBundle\Entity\User; | ||
13 | 15 | ||
14 | /** | 16 | /** |
15 | * Annotation. | 17 | * Annotation. |
@@ -21,6 +23,8 @@ use Wallabag\CoreBundle\Entity\Entry; | |||
21 | */ | 23 | */ |
22 | class Annotation | 24 | class Annotation |
23 | { | 25 | { |
26 | use EntityTimestampsTrait; | ||
27 | |||
24 | /** | 28 | /** |
25 | * @var int | 29 | * @var int |
26 | * | 30 | * |
@@ -56,7 +60,11 @@ class Annotation | |||
56 | /** | 60 | /** |
57 | * @var string | 61 | * @var string |
58 | * | 62 | * |
59 | * @ORM\Column(name="quote", type="string") | 63 | * @Assert\Length( |
64 | * max = 10000, | ||
65 | * maxMessage = "validator.quote_length_too_high" | ||
66 | * ) | ||
67 | * @ORM\Column(name="quote", type="text") | ||
60 | * | 68 | * |
61 | * @Groups({"entries_for_user", "export_all"}) | 69 | * @Groups({"entries_for_user", "export_all"}) |
62 | */ | 70 | */ |
@@ -129,18 +137,6 @@ class Annotation | |||
129 | } | 137 | } |
130 | 138 | ||
131 | /** | 139 | /** |
132 | * @ORM\PrePersist | ||
133 | * @ORM\PreUpdate | ||
134 | */ | ||
135 | public function timestamps() | ||
136 | { | ||
137 | if (is_null($this->createdAt)) { | ||
138 | $this->createdAt = new \DateTime(); | ||
139 | } | ||
140 | $this->updatedAt = new \DateTime(); | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * Get created. | 140 | * Get created. |
145 | * | 141 | * |
146 | * @return \DateTime | 142 | * @return \DateTime |