diff options
Diffstat (limited to 'src/Wallabag/UserBundle/Entity/User.php')
-rw-r--r-- | src/Wallabag/UserBundle/Entity/User.php | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index aba76ca7..20aca298 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php | |||
@@ -4,12 +4,12 @@ namespace Wallabag\UserBundle\Entity; | |||
4 | 4 | ||
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 FOS\UserBundle\Model\User as BaseUser; | ||
8 | use JMS\Serializer\Annotation\Accessor; | ||
7 | use JMS\Serializer\Annotation\Groups; | 9 | use JMS\Serializer\Annotation\Groups; |
8 | use JMS\Serializer\Annotation\XmlRoot; | 10 | use JMS\Serializer\Annotation\XmlRoot; |
9 | use JMS\Serializer\Annotation\Accessor; | ||
10 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; | 11 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; |
11 | use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; | 12 | use Scheb\TwoFactorBundle\Model\TrustedComputerInterface; |
12 | use FOS\UserBundle\Model\User as BaseUser; | ||
13 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | 13 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; |
14 | use Symfony\Component\Security\Core\User\UserInterface; | 14 | use Symfony\Component\Security\Core\User\UserInterface; |
15 | use Wallabag\ApiBundle\Entity\Client; | 15 | use Wallabag\ApiBundle\Entity\Client; |
@@ -93,36 +93,36 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf | |||
93 | protected $config; | 93 | protected $config; |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * @ORM\Column(type="integer", nullable=true) | 96 | * @var ArrayCollection |
97 | * | ||
98 | * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"}) | ||
97 | */ | 99 | */ |
98 | private $authCode; | 100 | protected $clients; |
99 | 101 | ||
100 | /** | 102 | /** |
101 | * @var bool | 103 | * @see getFirstClient() below |
102 | * | 104 | * |
103 | * @ORM\Column(type="boolean") | 105 | * @Groups({"user_api_with_client"}) |
106 | * @Accessor(getter="getFirstClient") | ||
104 | */ | 107 | */ |
105 | private $twoFactorAuthentication = false; | 108 | protected $default_client; |
106 | 109 | ||
107 | /** | 110 | /** |
108 | * @ORM\Column(type="json_array", nullable=true) | 111 | * @ORM\Column(type="integer", nullable=true) |
109 | */ | 112 | */ |
110 | private $trusted; | 113 | private $authCode; |
111 | 114 | ||
112 | /** | 115 | /** |
113 | * @var ArrayCollection | 116 | * @var bool |
114 | * | 117 | * |
115 | * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"}) | 118 | * @ORM\Column(type="boolean") |
116 | */ | 119 | */ |
117 | protected $clients; | 120 | private $twoFactorAuthentication = false; |
118 | 121 | ||
119 | /** | 122 | /** |
120 | * @see getFirstClient() below | 123 | * @ORM\Column(type="json_array", nullable=true) |
121 | * | ||
122 | * @Groups({"user_api_with_client"}) | ||
123 | * @Accessor(getter="getFirstClient") | ||
124 | */ | 124 | */ |
125 | protected $default_client; | 125 | private $trusted; |
126 | 126 | ||
127 | public function __construct() | 127 | public function __construct() |
128 | { | 128 | { |
@@ -137,7 +137,7 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf | |||
137 | */ | 137 | */ |
138 | public function timestamps() | 138 | public function timestamps() |
139 | { | 139 | { |
140 | if (is_null($this->createdAt)) { | 140 | if (null === $this->createdAt) { |
141 | $this->createdAt = new \DateTime(); | 141 | $this->createdAt = new \DateTime(); |
142 | } | 142 | } |
143 | 143 | ||