]>
Commit | Line | Data |
---|---|---|
9d50517c NL |
1 | <?php |
2 | ||
ad4d1caa | 3 | namespace Wallabag\CoreBundle\Entity; |
9d50517c NL |
4 | |
5 | use Doctrine\ORM\Mapping as ORM; | |
b84a8055 | 6 | use Symfony\Component\Validator\Constraints as Assert; |
9d50517c NL |
7 | |
8 | /** | |
9 | * Entries | |
10 | * | |
ad4d1caa | 11 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntriesRepository") |
9d50517c | 12 | * @ORM\Table(name="entries") |
c3235553 | 13 | * |
9d50517c NL |
14 | */ |
15 | class Entries | |
16 | { | |
17 | /** | |
18 | * @var integer | |
19 | * | |
20 | * @ORM\Column(name="id", type="integer", nullable=true) | |
21 | * @ORM\Id | |
22 | * @ORM\GeneratedValue(strategy="IDENTITY") | |
23 | */ | |
24 | private $id; | |
25 | ||
26 | /** | |
27 | * @var string | |
28 | * | |
29 | * @ORM\Column(name="title", type="text", nullable=true) | |
30 | */ | |
31 | private $title; | |
32 | ||
33 | /** | |
34 | * @var string | |
35 | * | |
b84a8055 | 36 | * @Assert\NotBlank() |
9d50517c NL |
37 | * @ORM\Column(name="url", type="text", nullable=true) |
38 | */ | |
39 | private $url; | |
40 | ||
41 | /** | |
42 | * @var string | |
43 | * | |
44 | * @ORM\Column(name="is_read", type="decimal", precision=10, scale=0, nullable=true) | |
45 | */ | |
46 | private $isRead = '0'; | |
47 | ||
48 | /** | |
49 | * @var string | |
50 | * | |
51 | * @ORM\Column(name="is_fav", type="decimal", precision=10, scale=0, nullable=true) | |
52 | */ | |
53 | private $isFav = '0'; | |
54 | ||
55 | /** | |
56 | * @var string | |
57 | * | |
58 | * @ORM\Column(name="content", type="text", nullable=true) | |
59 | */ | |
60 | private $content; | |
61 | ||
62 | /** | |
63 | * @var string | |
64 | * | |
65 | * @ORM\Column(name="user_id", type="decimal", precision=10, scale=0, nullable=true) | |
66 | */ | |
67 | private $userId; | |
68 | ||
42a90646 NL |
69 | /** |
70 | * @var string | |
71 | * | |
72 | * @ORM\Column(name="is_deleted", type="decimal", precision=10, scale=0, nullable=true) | |
73 | */ | |
74 | private $isDeleted = '0'; | |
75 | ||
9d50517c NL |
76 | /** |
77 | * Get id | |
78 | * | |
7df80cb3 | 79 | * @return integer |
9d50517c NL |
80 | */ |
81 | public function getId() | |
82 | { | |
83 | return $this->id; | |
84 | } | |
85 | ||
86 | /** | |
87 | * Set title | |
88 | * | |
7df80cb3 | 89 | * @param string $title |
9d50517c NL |
90 | * @return Entries |
91 | */ | |
92 | public function setTitle($title) | |
93 | { | |
94 | $this->title = $title; | |
95 | ||
96 | return $this; | |
97 | } | |
98 | ||
99 | /** | |
100 | * Get title | |
101 | * | |
7df80cb3 | 102 | * @return string |
9d50517c NL |
103 | */ |
104 | public function getTitle() | |
105 | { | |
106 | return $this->title; | |
107 | } | |
108 | ||
109 | /** | |
110 | * Set url | |
111 | * | |
7df80cb3 | 112 | * @param string $url |
9d50517c NL |
113 | * @return Entries |
114 | */ | |
115 | public function setUrl($url) | |
116 | { | |
117 | $this->url = $url; | |
118 | ||
119 | return $this; | |
120 | } | |
121 | ||
122 | /** | |
123 | * Get url | |
124 | * | |
7df80cb3 | 125 | * @return string |
9d50517c NL |
126 | */ |
127 | public function getUrl() | |
128 | { | |
129 | return $this->url; | |
130 | } | |
131 | ||
132 | /** | |
133 | * Set isRead | |
134 | * | |
7df80cb3 | 135 | * @param string $isRead |
9d50517c NL |
136 | * @return Entries |
137 | */ | |
138 | public function setIsRead($isRead) | |
139 | { | |
140 | $this->isRead = $isRead; | |
141 | ||
142 | return $this; | |
143 | } | |
144 | ||
145 | /** | |
146 | * Get isRead | |
147 | * | |
7df80cb3 | 148 | * @return string |
9d50517c NL |
149 | */ |
150 | public function getIsRead() | |
151 | { | |
152 | return $this->isRead; | |
153 | } | |
154 | ||
163eae0b NL |
155 | public function toggleArchive() |
156 | { | |
157 | $this->isRead = $this->getIsRead() ^ 1; | |
7df80cb3 | 158 | |
163eae0b NL |
159 | return $this; |
160 | } | |
161 | ||
9d50517c NL |
162 | /** |
163 | * Set isFav | |
164 | * | |
7df80cb3 | 165 | * @param string $isFav |
9d50517c NL |
166 | * @return Entries |
167 | */ | |
168 | public function setIsFav($isFav) | |
169 | { | |
170 | $this->isFav = $isFav; | |
171 | ||
172 | return $this; | |
173 | } | |
174 | ||
175 | /** | |
176 | * Get isFav | |
177 | * | |
7df80cb3 | 178 | * @return string |
9d50517c NL |
179 | */ |
180 | public function getIsFav() | |
181 | { | |
182 | return $this->isFav; | |
183 | } | |
184 | ||
163eae0b NL |
185 | public function toggleStar() |
186 | { | |
187 | $this->isFav = $this->getIsFav() ^ 1; | |
188 | ||
189 | return $this; | |
190 | } | |
191 | ||
9d50517c NL |
192 | /** |
193 | * Set content | |
194 | * | |
7df80cb3 | 195 | * @param string $content |
9d50517c NL |
196 | * @return Entries |
197 | */ | |
198 | public function setContent($content) | |
199 | { | |
200 | $this->content = $content; | |
201 | ||
202 | return $this; | |
203 | } | |
204 | ||
205 | /** | |
206 | * Get content | |
207 | * | |
7df80cb3 | 208 | * @return string |
9d50517c NL |
209 | */ |
210 | public function getContent() | |
211 | { | |
212 | return $this->content; | |
213 | } | |
214 | ||
215 | /** | |
216 | * Set userId | |
217 | * | |
7df80cb3 | 218 | * @param string $userId |
9d50517c NL |
219 | * @return Entries |
220 | */ | |
221 | public function setUserId($userId) | |
222 | { | |
223 | $this->userId = $userId; | |
224 | ||
225 | return $this; | |
226 | } | |
227 | ||
228 | /** | |
229 | * Get userId | |
230 | * | |
7df80cb3 | 231 | * @return string |
9d50517c NL |
232 | */ |
233 | public function getUserId() | |
234 | { | |
235 | return $this->userId; | |
236 | } | |
42a90646 NL |
237 | |
238 | /** | |
239 | * @return string | |
240 | */ | |
241 | public function isDeleted() | |
242 | { | |
243 | return $this->isDeleted; | |
244 | } | |
245 | ||
246 | /** | |
247 | * @param string $isDeleted | |
248 | */ | |
249 | public function setDeleted($isDeleted) | |
250 | { | |
251 | $this->isDeleted = $isDeleted; | |
252 | } | |
9d50517c | 253 | } |