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="comments", type="text", nullable=true)
94 * @ORM\Column(name="mimetype", type="text", nullable=true)
101 * @ORM\Column(name="reading_type", type="integer", nullable=true)
103 private $readingTime;
108 * @ORM\Column(name="domain_name", type="text", nullable=true)
115 * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false})
120 * @ORM\ManyToOne(targetEntity="User", inversedBy="entries")
127 public function __construct(User
$user)
137 public function getId()
145 * @param string $title
148 public function setTitle($title)
150 $this->title
= $title;
160 public function getTitle()
171 public function setUrl($url)
183 public function getUrl()
191 * @param string $isArchived
194 public function setArchived($isArchived)
196 $this->isArchived
= $isArchived;
206 public function isArchived()
208 return $this->isArchived
;
211 public function toggleArchive()
213 $this->isArchived
= $this->isArchived() ^
1;
221 * @param string $isStarred
224 public function setStarred($isStarred)
226 $this->isStarred
= $isStarred;
236 public function isStarred()
238 return $this->isStarred
;
241 public function toggleStar()
243 $this->isStarred
= $this->isStarred() ^
1;
251 * @param string $content
254 public function setContent($content)
256 $this->content
= $content;
266 public function getContent()
268 return $this->content
;
274 public function getUser()
282 public function isDeleted()
284 return $this->isDeleted
;
288 * @param string $isDeleted
290 public function setDeleted($isDeleted)
292 $this->isDeleted
= $isDeleted;
298 public function getCreatedAt()
300 return $this->createdAt
;
306 public function getUpdatedAt()
308 return $this->updatedAt
;
315 public function timestamps()
317 if (is_null($this->createdAt
)) {
318 $this->createdAt
= new \
DateTime();
321 $this->updatedAt
= new \
DateTime();
327 public function getComments()
329 return $this->comments
;
333 * @param string $comments
335 public function setComments($comments)
337 $this->comments
= $comments;
343 public function getMimetype()
345 return $this->mimetype
;
349 * @param string $mimetype
351 public function setMimetype($mimetype)
353 $this->mimetype
= $mimetype;
359 public function getReadingTime()
361 return $this->readingTime
;
365 * @param int $readingTime
367 public function setReadingTime($readingTime)
369 $this->readingTime
= $readingTime;
375 public function getDomainName()
377 return $this->domainName
;
381 * @param string $domainName
383 public function setDomainName($domainName)
385 $this->domainName
= $domainName;
391 public function isPublic()
393 return $this->isPublic
;
397 * @param boolean $isPublic
399 public function setPublic($isPublic)
401 $this->isPublic
= $isPublic;