aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Share.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Share.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Share.php140
1 files changed, 140 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Share.php b/src/Wallabag/CoreBundle/Entity/Share.php
new file mode 100644
index 00000000..a55b4e67
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Entity/Share.php
@@ -0,0 +1,140 @@
1<?php
2
3namespace Wallabag\CoreBundle\Entity;
4
5use Wallabag\FederationBundle\Entity\Account;
6use Wallabag\UserBundle\Entity\User;
7use Doctrine\ORM\Mapping as ORM;
8
9/**
10 * Share.
11 *
12 * @ORM\Entity
13 */
14class Share
15{
16 /**
17 * @var int
18 *
19 * @ORM\Column(name="id", type="integer")
20 * @ORM\Id
21 * @ORM\GeneratedValue(strategy="AUTO")
22 */
23 private $id;
24
25 /**
26 * @var Account
27 *
28 * @ORM\ManyToOne(targetEntity="Wallabag\FederationBundle\Entity\Account")
29 */
30 private $userOrigin;
31
32 /**
33 * @var Account
34 *
35 * @ORM\ManyToOne(targetEntity="Wallabag\FederationBundle\Entity\Account")
36 */
37 private $userDestination;
38
39 /**
40 * @var Entry
41 *
42 * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Entry")
43 */
44 private $entry;
45
46 /**
47 * @var boolean
48 *
49 * @ORM\Column(name="accepted", type="boolean")
50 */
51 private $accepted;
52
53 /**
54 * Share constructor.
55 */
56 public function __construct()
57 {
58 $this->accepted = false;
59 }
60
61 /**
62 * @return int
63 */
64 public function getId()
65 {
66 return $this->id;
67 }
68
69 /**
70 * @return Account
71 */
72 public function getUserOrigin()
73 {
74 return $this->userOrigin;
75 }
76
77 /**
78 * @param User $userOrigin
79 * @return Share
80 */
81 public function setUserOrigin(User $userOrigin)
82 {
83 $this->userOrigin = $userOrigin;
84 return $this;
85 }
86
87 /**
88 * @return Account
89 */
90 public function getUserDestination()
91 {
92 return $this->userDestination;
93 }
94
95 /**
96 * @param User $userDestination
97 * @return Share
98 */
99 public function setUserDestination(User $userDestination)
100 {
101 $this->userDestination = $userDestination;
102 return $this;
103 }
104
105 /**
106 * @return bool
107 */
108 public function isAccepted()
109 {
110 return $this->accepted;
111 }
112
113 /**
114 * @param bool $accepted
115 * @return Share
116 */
117 public function setAccepted($accepted)
118 {
119 $this->accepted = $accepted;
120 return $this;
121 }
122
123 /**
124 * @return Entry
125 */
126 public function getEntry()
127 {
128 return $this->entry;
129 }
130
131 /**
132 * @param Entry $entry
133 * @return Share
134 */
135 public function setEntry(Entry $entry)
136 {
137 $this->entry = $entry;
138 return $this;
139 }
140}