diff options
Diffstat (limited to 'src/Wallabag/UserBundle/Entity/User.php')
-rw-r--r-- | src/Wallabag/UserBundle/Entity/User.php | 16 |
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; | |||
15 | use Wallabag\ApiBundle\Entity\Client; | 15 | use Wallabag\ApiBundle\Entity\Client; |
16 | use Wallabag\CoreBundle\Entity\Config; | 16 | use Wallabag\CoreBundle\Entity\Config; |
17 | use Wallabag\CoreBundle\Entity\Entry; | 17 | use Wallabag\CoreBundle\Entity\Entry; |
18 | use Wallabag\CoreBundle\Helper\EntityTimestampsTrait; | ||
18 | 19 | ||
19 | /** | 20 | /** |
20 | * User. | 21 | * User. |
@@ -29,6 +30,8 @@ use Wallabag\CoreBundle\Entity\Entry; | |||
29 | */ | 30 | */ |
30 | class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface | 31 | class 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 |