X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FSiteCredential.php;h=dee48fd52982efd20f709f1cbce92edfe12f4de8;hb=feb239ea1006685ab3862c988309a1a5a9659559;hp=4d6557c59986845bd6046d6268db8eb94372a203;hpb=896f981ff522fe7d594e386a7112b23e593d6240;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/SiteCredential.php b/src/Wallabag/CoreBundle/Entity/SiteCredential.php index 4d6557c5..dee48fd5 100644 --- a/src/Wallabag/CoreBundle/Entity/SiteCredential.php +++ b/src/Wallabag/CoreBundle/Entity/SiteCredential.php @@ -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; } }