mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
rename Entries to Entry
This commit is contained in:
parent
905ae369bd
commit
be463487cc
5 changed files with 58 additions and 61 deletions
412
src/Wallabag/CoreBundle/Entity/Entry.php
Normal file
412
src/Wallabag/CoreBundle/Entity/Entry.php
Normal file
|
@ -0,0 +1,412 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Entry
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository")
|
||||
* @ORM\Table(name="entry")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
*
|
||||
*/
|
||||
class Entry
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="title", type="text", nullable=true)
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @Assert\NotBlank()
|
||||
* @ORM\Column(name="url", type="text", nullable=true)
|
||||
*/
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_archived", type="boolean")
|
||||
*/
|
||||
private $isArchived = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_starred", type="boolean")
|
||||
*/
|
||||
private $isStarred = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_deleted", type="boolean")
|
||||
*/
|
||||
private $isDeleted = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="content", type="text", nullable=true)
|
||||
*/
|
||||
private $content;
|
||||
|
||||
/**
|
||||
* @var date
|
||||
*
|
||||
* @ORM\Column(name="created_at", type="datetime")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
||||
/**
|
||||
* @var date
|
||||
*
|
||||
* @ORM\Column(name="updated_at", type="datetime")
|
||||
*/
|
||||
private $updatedAt;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="user_id", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $userId;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="comments", type="text", nullable=true)
|
||||
*/
|
||||
private $comments;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mimetype", type="text", nullable=true)
|
||||
*/
|
||||
private $mimetype;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="reading_type", type="integer", nullable=true)
|
||||
*/
|
||||
private $readingTime;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="domain_name", type="text", nullable=true)
|
||||
*/
|
||||
private $domainName;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false})
|
||||
*/
|
||||
private $isPublic;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set title
|
||||
*
|
||||
* @param string $title
|
||||
* @return Entry
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set url
|
||||
*
|
||||
* @param string $url
|
||||
* @return Entry
|
||||
*/
|
||||
public function setUrl($url)
|
||||
{
|
||||
$this->url = $url;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get url
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isArchived
|
||||
*
|
||||
* @param string $isArchived
|
||||
* @return Entry
|
||||
*/
|
||||
public function setArchived($isArchived)
|
||||
{
|
||||
$this->isArchived = $isArchived;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isArchived
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function isArchived()
|
||||
{
|
||||
return $this->isArchived;
|
||||
}
|
||||
|
||||
public function toggleArchive()
|
||||
{
|
||||
$this->isArchived = $this->isArchived() ^ 1;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isStarred
|
||||
*
|
||||
* @param string $isStarred
|
||||
* @return Entry
|
||||
*/
|
||||
public function setStarred($isStarred)
|
||||
{
|
||||
$this->isStarred = $isStarred;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isStarred
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function isStarred()
|
||||
{
|
||||
return $this->isStarred;
|
||||
}
|
||||
|
||||
public function toggleStar()
|
||||
{
|
||||
$this->isStarred = $this->isStarred() ^ 1;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set content
|
||||
*
|
||||
* @param string $content
|
||||
* @return Entry
|
||||
*/
|
||||
public function setContent($content)
|
||||
{
|
||||
$this->content = $content;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get content
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set userId
|
||||
*
|
||||
* @param string $userId
|
||||
* @return Entry
|
||||
*/
|
||||
public function setUserId($userId)
|
||||
{
|
||||
$this->userId = $userId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get userId
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUserId()
|
||||
{
|
||||
return $this->userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function isDeleted()
|
||||
{
|
||||
return $this->isDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $isDeleted
|
||||
*/
|
||||
public function setDeleted($isDeleted)
|
||||
{
|
||||
$this->isDeleted = $isDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ORM\PrePersist
|
||||
* @ORM\PreUpdate
|
||||
*/
|
||||
public function timestamps()
|
||||
{
|
||||
if (is_null($this->createdAt)) {
|
||||
$this->createdAt = new \DateTime();
|
||||
}
|
||||
|
||||
$this->updatedAt = new \DateTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getComments()
|
||||
{
|
||||
return $this->comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $comments
|
||||
*/
|
||||
public function setComments($comments)
|
||||
{
|
||||
$this->comments = $comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMimetype()
|
||||
{
|
||||
return $this->mimetype;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $mimetype
|
||||
*/
|
||||
public function setMimetype($mimetype)
|
||||
{
|
||||
$this->mimetype = $mimetype;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getReadingTime()
|
||||
{
|
||||
return $this->readingTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $readingTime
|
||||
*/
|
||||
public function setReadingTime($readingTime)
|
||||
{
|
||||
$this->readingTime = $readingTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDomainName()
|
||||
{
|
||||
return $this->domainName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $domainName
|
||||
*/
|
||||
public function setDomainName($domainName)
|
||||
{
|
||||
$this->domainName = $domainName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isPublic()
|
||||
{
|
||||
return $this->isPublic;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $isPublic
|
||||
*/
|
||||
public function setPublic($isPublic)
|
||||
{
|
||||
$this->isPublic = $isPublic;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue