aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle/Entity/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/UserBundle/Entity/User.php')
-rw-r--r--src/Wallabag/UserBundle/Entity/User.php16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php
index 53c327f9..48446e3c 100644
--- a/src/Wallabag/UserBundle/Entity/User.php
+++ b/src/Wallabag/UserBundle/Entity/User.php
@@ -15,6 +15,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
15use Wallabag\ApiBundle\Entity\Client; 15use Wallabag\ApiBundle\Entity\Client;
16use Wallabag\CoreBundle\Entity\Config; 16use Wallabag\CoreBundle\Entity\Config;
17use Wallabag\CoreBundle\Entity\Entry; 17use Wallabag\CoreBundle\Entity\Entry;
18use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
18 19
19/** 20/**
20 * User. 21 * User.
@@ -29,6 +30,8 @@ use Wallabag\CoreBundle\Entity\Entry;
29 */ 30 */
30class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface 31class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface
31{ 32{
33 use EntityTimestampsTrait;
34
32 /** @Serializer\XmlAttribute */ 35 /** @Serializer\XmlAttribute */
33 /** 36 /**
34 * @var int 37 * @var int
@@ -139,19 +142,6 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
139 } 142 }
140 143
141 /** 144 /**
142 * @ORM\PrePersist
143 * @ORM\PreUpdate
144 */
145 public function timestamps()
146 {
147 if (null === $this->createdAt) {
148 $this->createdAt = new \DateTime();
149 }
150
151 $this->updatedAt = new \DateTime();
152 }
153
154 /**
155 * Set name. 145 * Set name.
156 * 146 *
157 * @param string $name 147 * @param string $name