namespace Wallabag\AnnotationBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
-use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Exclude;
-use JMS\Serializer\Annotation\VirtualProperty;
-use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Groups;
-use Wallabag\UserBundle\Entity\User;
+use JMS\Serializer\Annotation\SerializedName;
+use JMS\Serializer\Annotation\VirtualProperty;
+use Symfony\Component\Validator\Constraints as Assert;
use Wallabag\CoreBundle\Entity\Entry;
+use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
+use Wallabag\UserBundle\Entity\User;
/**
* Annotation.
*/
class Annotation
{
+ use EntityTimestampsTrait;
+
/**
* @var int
*
/**
* @var string
*
- * @ORM\Column(name="quote", type="string")
+ * @Assert\Length(
+ * max = 10000,
+ * maxMessage = "validator.quote_length_too_high"
+ * )
+ * @ORM\Column(name="quote", type="text")
*
* @Groups({"entries_for_user", "export_all"})
*/
return $this->text;
}
- /**
- * @ORM\PrePersist
- * @ORM\PreUpdate
- */
- public function timestamps()
- {
- if (is_null($this->createdAt)) {
- $this->createdAt = new \DateTime();
- }
- $this->updatedAt = new \DateTime();
- }
-
/**
* Get created.
*