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