]>
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 | ||
69 | ||
70 | ||
71 | /** | |
72 | * Get id | |
73 | * | |
74 | * @return integer | |
75 | */ | |
76 | public function getId() | |
77 | { | |
78 | return $this->id; | |
79 | } | |
80 | ||
81 | /** | |
82 | * Set title | |
83 | * | |
84 | * @param string $title | |
85 | * @return Entries | |
86 | */ | |
87 | public function setTitle($title) | |
88 | { | |
89 | $this->title = $title; | |
90 | ||
91 | return $this; | |
92 | } | |
93 | ||
94 | /** | |
95 | * Get title | |
96 | * | |
97 | * @return string | |
98 | */ | |
99 | public function getTitle() | |
100 | { | |
101 | return $this->title; | |
102 | } | |
103 | ||
104 | /** | |
105 | * Set url | |
106 | * | |
107 | * @param string $url | |
108 | * @return Entries | |
109 | */ | |
110 | public function setUrl($url) | |
111 | { | |
112 | $this->url = $url; | |
113 | ||
114 | return $this; | |
115 | } | |
116 | ||
117 | /** | |
118 | * Get url | |
119 | * | |
120 | * @return string | |
121 | */ | |
122 | public function getUrl() | |
123 | { | |
124 | return $this->url; | |
125 | } | |
126 | ||
127 | /** | |
128 | * Set isRead | |
129 | * | |
130 | * @param string $isRead | |
131 | * @return Entries | |
132 | */ | |
133 | public function setIsRead($isRead) | |
134 | { | |
135 | $this->isRead = $isRead; | |
136 | ||
137 | return $this; | |
138 | } | |
139 | ||
140 | /** | |
141 | * Get isRead | |
142 | * | |
143 | * @return string | |
144 | */ | |
145 | public function getIsRead() | |
146 | { | |
147 | return $this->isRead; | |
148 | } | |
149 | ||
163eae0b NL |
150 | public function toggleArchive() |
151 | { | |
152 | $this->isRead = $this->getIsRead() ^ 1; | |
153 | return $this; | |
154 | } | |
155 | ||
9d50517c NL |
156 | /** |
157 | * Set isFav | |
158 | * | |
159 | * @param string $isFav | |
160 | * @return Entries | |
161 | */ | |
162 | public function setIsFav($isFav) | |
163 | { | |
164 | $this->isFav = $isFav; | |
165 | ||
166 | return $this; | |
167 | } | |
168 | ||
169 | /** | |
170 | * Get isFav | |
171 | * | |
172 | * @return string | |
173 | */ | |
174 | public function getIsFav() | |
175 | { | |
176 | return $this->isFav; | |
177 | } | |
178 | ||
163eae0b NL |
179 | public function toggleStar() |
180 | { | |
181 | $this->isFav = $this->getIsFav() ^ 1; | |
182 | ||
183 | return $this; | |
184 | } | |
185 | ||
9d50517c NL |
186 | /** |
187 | * Set content | |
188 | * | |
189 | * @param string $content | |
190 | * @return Entries | |
191 | */ | |
192 | public function setContent($content) | |
193 | { | |
194 | $this->content = $content; | |
195 | ||
196 | return $this; | |
197 | } | |
198 | ||
199 | /** | |
200 | * Get content | |
201 | * | |
202 | * @return string | |
203 | */ | |
204 | public function getContent() | |
205 | { | |
206 | return $this->content; | |
207 | } | |
208 | ||
209 | /** | |
210 | * Set userId | |
211 | * | |
212 | * @param string $userId | |
213 | * @return Entries | |
214 | */ | |
215 | public function setUserId($userId) | |
216 | { | |
217 | $this->userId = $userId; | |
218 | ||
219 | return $this; | |
220 | } | |
221 | ||
222 | /** | |
223 | * Get userId | |
224 | * | |
225 | * @return string | |
226 | */ | |
227 | public function getUserId() | |
228 | { | |
229 | return $this->userId; | |
230 | } | |
231 | } |