aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/AnnotationBundle/Entity/Annotation.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-10-23 11:09:17 +0200
committerGitHub <noreply@github.com>2017-10-23 11:09:17 +0200
commit1953a872932a63792293b4aec087880265ba89f7 (patch)
treefd16599e737fcdaf193c933ef3ec4a4ee248b117 /src/Wallabag/AnnotationBundle/Entity/Annotation.php
parentd83d25dadec2c38460a32d96f5d2903426fec9d3 (diff)
parent702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff)
downloadwallabag-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.php30
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 @@
3namespace Wallabag\AnnotationBundle\Entity; 3namespace Wallabag\AnnotationBundle\Entity;
4 4
5use Doctrine\ORM\Mapping as ORM; 5use Doctrine\ORM\Mapping as ORM;
6use JMS\Serializer\Annotation\ExclusionPolicy;
7use JMS\Serializer\Annotation\Exclude; 6use JMS\Serializer\Annotation\Exclude;
8use JMS\Serializer\Annotation\VirtualProperty; 7use JMS\Serializer\Annotation\ExclusionPolicy;
9use JMS\Serializer\Annotation\SerializedName;
10use JMS\Serializer\Annotation\Groups; 8use JMS\Serializer\Annotation\Groups;
11use Wallabag\UserBundle\Entity\User; 9use JMS\Serializer\Annotation\SerializedName;
10use JMS\Serializer\Annotation\VirtualProperty;
11use Symfony\Component\Validator\Constraints as Assert;
12use Wallabag\CoreBundle\Entity\Entry; 12use Wallabag\CoreBundle\Entity\Entry;
13use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
14use Wallabag\UserBundle\Entity\User;
13 15
14/** 16/**
15 * Annotation. 17 * Annotation.
@@ -21,6 +23,8 @@ use Wallabag\CoreBundle\Entity\Entry;
21 */ 23 */
22class Annotation 24class 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