diff options
Diffstat (limited to 'src/Wallabag/UserBundle')
-rw-r--r-- | src/Wallabag/UserBundle/Entity/User.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index 1863c966..1ff3046a 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php | |||
@@ -5,11 +5,10 @@ namespace Wallabag\UserBundle\Entity; | |||
5 | use Doctrine\Common\Collections\ArrayCollection; | 5 | use Doctrine\Common\Collections\ArrayCollection; |
6 | use Doctrine\ORM\Mapping as ORM; | 6 | use Doctrine\ORM\Mapping as ORM; |
7 | use JMS\Serializer\Annotation\Groups; | 7 | use JMS\Serializer\Annotation\Groups; |
8 | use JMS\Serializer\Annotation\XmlRoot; | ||
8 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; | 9 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; |
9 | use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; | 10 | use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; |
10 | use FOS\UserBundle\Model\User as BaseUser; | 11 | use FOS\UserBundle\Model\User as BaseUser; |
11 | use JMS\Serializer\Annotation\ExclusionPolicy; | ||
12 | use JMS\Serializer\Annotation\Expose; | ||
13 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | 12 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; |
14 | use Symfony\Component\Security\Core\User\UserInterface; | 13 | use Symfony\Component\Security\Core\User\UserInterface; |
15 | use Wallabag\ApiBundle\Entity\Client; | 14 | use Wallabag\ApiBundle\Entity\Client; |
@@ -19,23 +18,24 @@ use Wallabag\CoreBundle\Entity\Entry; | |||
19 | /** | 18 | /** |
20 | * User. | 19 | * User. |
21 | * | 20 | * |
21 | * @XmlRoot("user") | ||
22 | * @ORM\Entity(repositoryClass="Wallabag\UserBundle\Repository\UserRepository") | 22 | * @ORM\Entity(repositoryClass="Wallabag\UserBundle\Repository\UserRepository") |
23 | * @ORM\Table(name="`user`") | 23 | * @ORM\Table(name="`user`") |
24 | * @ORM\HasLifecycleCallbacks() | 24 | * @ORM\HasLifecycleCallbacks() |
25 | * @ExclusionPolicy("all") | ||
26 | * | 25 | * |
27 | * @UniqueEntity("email") | 26 | * @UniqueEntity("email") |
28 | * @UniqueEntity("username") | 27 | * @UniqueEntity("username") |
29 | */ | 28 | */ |
30 | class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface | 29 | class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterface |
31 | { | 30 | { |
31 | /** @Serializer\XmlAttribute */ | ||
32 | /** | 32 | /** |
33 | * @var int | 33 | * @var int |
34 | * | 34 | * |
35 | * @Expose | ||
36 | * @ORM\Column(name="id", type="integer") | 35 | * @ORM\Column(name="id", type="integer") |
37 | * @ORM\Id | 36 | * @ORM\Id |
38 | * @ORM\GeneratedValue(strategy="AUTO") | 37 | * @ORM\GeneratedValue(strategy="AUTO") |
38 | * | ||
39 | * @Groups({"user_api"}) | 39 | * @Groups({"user_api"}) |
40 | */ | 40 | */ |
41 | protected $id; | 41 | protected $id; |
@@ -44,14 +44,30 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf | |||
44 | * @var string | 44 | * @var string |
45 | * | 45 | * |
46 | * @ORM\Column(name="name", type="text", nullable=true) | 46 | * @ORM\Column(name="name", type="text", nullable=true) |
47 | * | ||
47 | * @Groups({"user_api"}) | 48 | * @Groups({"user_api"}) |
48 | */ | 49 | */ |
49 | protected $name; | 50 | protected $name; |
50 | 51 | ||
51 | /** | 52 | /** |
53 | * @var string | ||
54 | * | ||
55 | * @Groups({"user_api"}) | ||
56 | */ | ||
57 | protected $username; | ||
58 | |||
59 | /** | ||
60 | * @var string | ||
61 | * | ||
62 | * @Groups({"user_api"}) | ||
63 | */ | ||
64 | protected $email; | ||
65 | |||
66 | /** | ||
52 | * @var date | 67 | * @var date |
53 | * | 68 | * |
54 | * @ORM\Column(name="created_at", type="datetime") | 69 | * @ORM\Column(name="created_at", type="datetime") |
70 | * | ||
55 | * @Groups({"user_api"}) | 71 | * @Groups({"user_api"}) |
56 | */ | 72 | */ |
57 | protected $createdAt; | 73 | protected $createdAt; |
@@ -60,6 +76,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf | |||
60 | * @var date | 76 | * @var date |
61 | * | 77 | * |
62 | * @ORM\Column(name="updated_at", type="datetime") | 78 | * @ORM\Column(name="updated_at", type="datetime") |
79 | * | ||
63 | * @Groups({"user_api"}) | 80 | * @Groups({"user_api"}) |
64 | */ | 81 | */ |
65 | protected $updatedAt; | 82 | protected $updatedAt; |