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