aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
authorJeremy <jeremy.benoist@gmail.com>2015-02-17 22:45:20 +0100
committerJeremy <jeremy.benoist@gmail.com>2015-02-17 22:45:20 +0100
commitc0d9eba07f40a52bdfcfca3e7a926163b17d83ab (patch)
treeb80e1e1a4dc51519b28ea995e411231d35135763 /src/Wallabag/CoreBundle/Entity
parentd9085c63e35bb708f560722fff5f4f5ad322c27b (diff)
downloadwallabag-c0d9eba07f40a52bdfcfca3e7a926163b17d83ab.tar.gz
wallabag-c0d9eba07f40a52bdfcfca3e7a926163b17d83ab.tar.zst
wallabag-c0d9eba07f40a52bdfcfca3e7a926163b17d83ab.zip
Updating logged in user (email, name, etc ..)
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/User.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php
index c83250c3..193dfebc 100644
--- a/src/Wallabag/CoreBundle/Entity/User.php
+++ b/src/Wallabag/CoreBundle/Entity/User.php
@@ -6,6 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection;
6use Doctrine\ORM\Mapping as ORM; 6use Doctrine\ORM\Mapping as ORM;
7use Symfony\Component\Security\Core\User\UserInterface; 7use Symfony\Component\Security\Core\User\UserInterface;
8use Symfony\Component\Security\Core\User\AdvancedUserInterface; 8use Symfony\Component\Security\Core\User\AdvancedUserInterface;
9use Symfony\Component\Validator\Constraints as Assert;
9 10
10/** 11/**
11 * User 12 * User
@@ -29,6 +30,11 @@ class User implements AdvancedUserInterface, \Serializable
29 * @var string 30 * @var string
30 * 31 *
31 * @ORM\Column(name="username", type="text") 32 * @ORM\Column(name="username", type="text")
33 * @Assert\NotBlank()
34 * @Assert\Length(
35 * min = "3",
36 * max = "255"
37 * )
32 */ 38 */
33 private $username; 39 private $username;
34 40
@@ -56,14 +62,16 @@ class User implements AdvancedUserInterface, \Serializable
56 /** 62 /**
57 * @var string 63 * @var string
58 * 64 *
59 * @ORM\Column(name="email", type="text", nullable=true) 65 * @ORM\Column(name="email", type="text", nullable=false)
66 * @Assert\Email()
67 * @Assert\NotBlank()
60 */ 68 */
61 private $email; 69 private $email;
62 70
63 /** 71 /**
64 * @ORM\Column(name="is_active", type="boolean") 72 * @ORM\Column(name="is_active", type="boolean", nullable=false)
65 */ 73 */
66 private $isActive; 74 private $isActive = true;
67 75
68 /** 76 /**
69 * @var date 77 * @var date
@@ -86,9 +94,8 @@ class User implements AdvancedUserInterface, \Serializable
86 94
87 public function __construct() 95 public function __construct()
88 { 96 {
89 $this->isActive = true; 97 $this->salt = md5(uniqid(null, true));
90 $this->salt = md5(uniqid(null, true)); 98 $this->entries = new ArrayCollection();
91 $this->entries = new ArrayCollection();
92 } 99 }
93 100
94 /** 101 /**