aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php2
-rw-r--r--src/Wallabag/CoreBundle/Entity/User.php27
2 files changed, 28 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index 7b4464a1..91f9bfe8 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -48,7 +48,7 @@ class Config
48 private $language; 48 private $language;
49 49
50 /** 50 /**
51 * @ORM\ManyToOne(targetEntity="User", inversedBy="config") 51 * @ORM\OneToOne(targetEntity="User", inversedBy="config")
52 */ 52 */
53 private $user; 53 private $user;
54 54
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php
index 193dfebc..ed5cfe53 100644
--- a/src/Wallabag/CoreBundle/Entity/User.php
+++ b/src/Wallabag/CoreBundle/Entity/User.php
@@ -92,6 +92,11 @@ class User implements AdvancedUserInterface, \Serializable
92 */ 92 */
93 private $entries; 93 private $entries;
94 94
95 /**
96 * @ORM\OneToOne(targetEntity="Config", mappedBy="user")
97 */
98 private $config;
99
95 public function __construct() 100 public function __construct()
96 { 101 {
97 $this->salt = md5(uniqid(null, true)); 102 $this->salt = md5(uniqid(null, true));
@@ -320,4 +325,26 @@ class User implements AdvancedUserInterface, \Serializable
320 { 325 {
321 return $this->isActive; 326 return $this->isActive;
322 } 327 }
328 /**
329 * Set config
330 *
331 * @param \Wallabag\CoreBundle\Entity\Config $config
332 * @return User
333 */
334 public function setConfig(\Wallabag\CoreBundle\Entity\Config $config = null)
335 {
336 $this->config = $config;
337
338 return $this;
339 }
340
341 /**
342 * Get config
343 *
344 * @return \Wallabag\CoreBundle\Entity\Config
345 */
346 public function getConfig()
347 {
348 return $this->config;
349 }
323} 350}