aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Entry.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-06 15:18:54 +0100
committerJeremy <jeremy.benoist@gmail.com>2015-02-08 23:13:40 +0100
commit5f09650eef7bea52b7c54c074c0f873f96e53c86 (patch)
tree1445f0f07ee0cc04b57e0228f3fded0bdfcf3c94 /src/Wallabag/CoreBundle/Entity/Entry.php
parent8af35ad932177e0363412a868afc128b406e3322 (diff)
downloadwallabag-5f09650eef7bea52b7c54c074c0f873f96e53c86.tar.gz
wallabag-5f09650eef7bea52b7c54c074c0f873f96e53c86.tar.zst
wallabag-5f09650eef7bea52b7c54c074c0f873f96e53c86.zip
add a real relation between user and entry
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php41
1 files changed, 16 insertions, 25 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index a00762ca..937213b4 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -84,13 +84,6 @@ class Entry
84 /** 84 /**
85 * @var string 85 * @var string
86 * 86 *
87 * @ORM\Column(name="user_id", type="decimal", precision=10, scale=0, nullable=true)
88 */
89 private $userId;
90
91 /**
92 * @var string
93 *
94 * @ORM\Column(name="comments", type="text", nullable=true) 87 * @ORM\Column(name="comments", type="text", nullable=true)
95 */ 88 */
96 private $comments; 89 private $comments;
@@ -124,6 +117,19 @@ class Entry
124 private $isPublic; 117 private $isPublic;
125 118
126 /** 119 /**
120 * @ORM\ManyToOne(targetEntity="User", inversedBy="entries")
121 */
122 private $user;
123
124 /*
125 * @param User $user
126 */
127 public function __construct(User $user)
128 {
129 $this->user = $user;
130 }
131
132 /**
127 * Get id 133 * Get id
128 * 134 *
129 * @return integer 135 * @return integer
@@ -263,26 +269,11 @@ class Entry
263 } 269 }
264 270
265 /** 271 /**
266 * Set userId 272 * @return User
267 *
268 * @param string $userId
269 * @return Entry
270 */
271 public function setUserId($userId)
272 {
273 $this->userId = $userId;
274
275 return $this;
276 }
277
278 /**
279 * Get userId
280 *
281 * @return string
282 */ 273 */
283 public function getUserId() 274 public function getUser()
284 { 275 {
285 return $this->userId; 276 return $this->user;
286 } 277 }
287 278
288 /** 279 /**