3 namespace Wallabag\CoreBundle\Entity
;
5 use Doctrine\ORM\Mapping
as ORM
;
6 use Symfony\Component\Validator\Constraints
as Assert
;
11 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository")
12 * @ORM\Table(name="entry")
13 * @ORM\HasLifecycleCallbacks()
21 * @ORM\Column(name="id", type="integer")
23 * @ORM\GeneratedValue(strategy="AUTO")
30 * @ORM\Column(name="title", type="text", nullable=true)
38 * @ORM\Column(name="url", type="text", nullable=true)
45 * @ORM\Column(name="is_archived", type="boolean")
47 private $isArchived = false;
52 * @ORM\Column(name="is_starred", type="boolean")
54 private $isStarred = false;
59 * @ORM\Column(name="is_deleted", type="boolean")
61 private $isDeleted = false;
66 * @ORM\Column(name="content", type="text", nullable=true)
73 * @ORM\Column(name="created_at", type="datetime")
80 * @ORM\Column(name="updated_at", type="datetime")
87 * @ORM\Column(name="user_id", type="decimal", precision=10, scale=0, nullable=true)
94 * @ORM\Column(name="comments", type="text", nullable=true)
101 * @ORM\Column(name="mimetype", type="text", nullable=true)
108 * @ORM\Column(name="reading_type", type="integer", nullable=true)
110 private $readingTime;
115 * @ORM\Column(name="domain_name", type="text", nullable=true)
122 * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false})
131 public function getId()
139 * @param string $title
142 public function setTitle($title)
144 $this->title
= $title;
154 public function getTitle()
165 public function setUrl($url)
177 public function getUrl()
185 * @param string $isArchived
188 public function setArchived($isArchived)
190 $this->isArchived
= $isArchived;
200 public function isArchived()
202 return $this->isArchived
;
205 public function toggleArchive()
207 $this->isArchived
= $this->isArchived() ^
1;
215 * @param string $isStarred
218 public function setStarred($isStarred)
220 $this->isStarred
= $isStarred;
230 public function isStarred()
232 return $this->isStarred
;
235 public function toggleStar()
237 $this->isStarred
= $this->isStarred() ^
1;
245 * @param string $content
248 public function setContent($content)
250 $this->content
= $content;
260 public function getContent()
262 return $this->content
;
268 * @param string $userId
271 public function setUserId($userId)
273 $this->userId
= $userId;
283 public function getUserId()
285 return $this->userId
;
291 public function isDeleted()
293 return $this->isDeleted
;
297 * @param string $isDeleted
299 public function setDeleted($isDeleted)
301 $this->isDeleted
= $isDeleted;
307 public function getCreatedAt()
309 return $this->createdAt
;
315 public function getUpdatedAt()
317 return $this->updatedAt
;
324 public function timestamps()
326 if (is_null($this->createdAt
)) {
327 $this->createdAt
= new \
DateTime();
330 $this->updatedAt
= new \
DateTime();
336 public function getComments()
338 return $this->comments
;
342 * @param string $comments
344 public function setComments($comments)
346 $this->comments
= $comments;
352 public function getMimetype()
354 return $this->mimetype
;
358 * @param string $mimetype
360 public function setMimetype($mimetype)
362 $this->mimetype
= $mimetype;
368 public function getReadingTime()
370 return $this->readingTime
;
374 * @param int $readingTime
376 public function setReadingTime($readingTime)
378 $this->readingTime
= $readingTime;
384 public function getDomainName()
386 return $this->domainName
;
390 * @param string $domainName
392 public function setDomainName($domainName)
394 $this->domainName
= $domainName;
400 public function isPublic()
402 return $this->isPublic
;
406 * @param boolean $isPublic
408 public function setPublic($isPublic)
410 $this->isPublic
= $isPublic;