From 5f09650eef7bea52b7c54c074c0f873f96e53c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 6 Feb 2015 15:18:54 +0100 Subject: add a real relation between user and entry --- src/Wallabag/CoreBundle/Entity/Entry.php | 41 +++++++++++++------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php') 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 @@ -81,13 +81,6 @@ class Entry */ private $updatedAt; - /** - * @var string - * - * @ORM\Column(name="user_id", type="decimal", precision=10, scale=0, nullable=true) - */ - private $userId; - /** * @var string * @@ -123,6 +116,19 @@ class Entry */ private $isPublic; + /** + * @ORM\ManyToOne(targetEntity="User", inversedBy="entries") + */ + private $user; + + /* + * @param User $user + */ + public function __construct(User $user) + { + $this->user = $user; + } + /** * Get id * @@ -263,26 +269,11 @@ class Entry } /** - * Set userId - * - * @param string $userId - * @return Entry - */ - public function setUserId($userId) - { - $this->userId = $userId; - - return $this; - } - - /** - * Get userId - * - * @return string + * @return User */ - public function getUserId() + public function getUser() { - return $this->userId; + return $this->user; } /** -- cgit v1.2.3