]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/SiteCredential.php
Merge remote-tracking branch 'origin/master' into 2.4
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / SiteCredential.php
index 4d6557c59986845bd6046d6268db8eb94372a203..dee48fd52982efd20f709f1cbce92edfe12f4de8 100644 (file)
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
 use Symfony\Component\Validator\Constraints as Assert;
+use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
 use Wallabag\UserBundle\Entity\User;
 
 /**
@@ -15,6 +16,8 @@ use Wallabag\UserBundle\Entity\User;
  */
 class SiteCredential
 {
+    use EntityTimestampsTrait;
+
     /**
      * @var int
      *
@@ -56,6 +59,13 @@ class SiteCredential
      */
     private $createdAt;
 
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="updated_at", type="datetime")
+     */
+    private $updatedAt;
+
     /**
      * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="siteCredentials")
      */
@@ -176,20 +186,20 @@ class SiteCredential
     }
 
     /**
-     * @return User
+     * Get updatedAt.
+     *
+     * @return \DateTime
      */
-    public function getUser()
+    public function getUpdatedAt()
     {
-        return $this->user;
+        return $this->updatedAt;
     }
 
     /**
-     * @ORM\PrePersist
+     * @return User
      */
-    public function timestamps()
+    public function getUser()
     {
-        if (null === $this->createdAt) {
-            $this->createdAt = new \DateTime();
-        }
+        return $this->user;
     }
 }