diff options
Diffstat (limited to 'src/Wallabag/UserBundle/Entity/User.php')
-rw-r--r-- | src/Wallabag/UserBundle/Entity/User.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index aed5c73e..f11a277d 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\FederationBundle\Entity\Account; | ||
18 | 19 | ||
19 | /** | 20 | /** |
20 | * User. | 21 | * User. |
@@ -129,6 +130,14 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf | |||
129 | */ | 130 | */ |
130 | protected $default_client; | 131 | protected $default_client; |
131 | 132 | ||
133 | /** | ||
134 | * @ORM\OneToOne(targetEntity="Wallabag\FederationBundle\Entity\Account", mappedBy="user", cascade={"remove"}) | ||
135 | */ | ||
136 | protected $account; | ||
137 | |||
138 | /** | ||
139 | * User constructor. | ||
140 | */ | ||
132 | public function __construct() | 141 | public function __construct() |
133 | { | 142 | { |
134 | parent::__construct(); | 143 | parent::__construct(); |
@@ -333,4 +342,22 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf | |||
333 | { | 342 | { |
334 | $this->notifications = $notifications; | 343 | $this->notifications = $notifications; |
335 | } | 344 | } |
345 | |||
346 | /** | ||
347 | * @return Account | ||
348 | */ | ||
349 | public function getAccount() | ||
350 | { | ||
351 | return $this->account; | ||
352 | } | ||
353 | |||
354 | /** | ||
355 | * @param mixed $account | ||
356 | * @return User | ||
357 | */ | ||
358 | public function setAccount(Account $account) | ||
359 | { | ||
360 | $this->account = $account; | ||
361 | return $this; | ||
362 | } | ||
336 | } | 363 | } |