X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FAnnotationBundle%2FEntity%2FAnnotation.php;h=a180d504786c866686a70e34b8510d133e9e3b11;hb=a6beec1bd2b0f988fc2b032b84160b84b499cc9b;hp=c8e4164972643df7e9e637e954fee0fc7edb74b5;hpb=2c3e148b0029a094431622feac79fafcd0d43fc8;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/AnnotationBundle/Entity/Annotation.php b/src/Wallabag/AnnotationBundle/Entity/Annotation.php index c8e41649..a180d504 100644 --- a/src/Wallabag/AnnotationBundle/Entity/Annotation.php +++ b/src/Wallabag/AnnotationBundle/Entity/Annotation.php @@ -3,14 +3,15 @@ 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 JMS\Serializer\Annotation\SerializedName; +use JMS\Serializer\Annotation\VirtualProperty; use Symfony\Component\Validator\Constraints as Assert; -use Wallabag\UserBundle\Entity\User; use Wallabag\CoreBundle\Entity\Entry; +use Wallabag\CoreBundle\Helper\EntityTimestampsTrait; +use Wallabag\UserBundle\Entity\User; /** * Annotation. @@ -22,6 +23,8 @@ use Wallabag\CoreBundle\Entity\Entry; */ class Annotation { + use EntityTimestampsTrait; + /** * @var int * @@ -133,18 +136,6 @@ class Annotation 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. *