X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FEntity%2FEntries.php;h=ab5b859b87ac8c405e79c90c0429d13d5fed58f4;hb=2c093b03de92fb050a50cd4db183ba55abd4ff84;hp=3c061a37bc5f1dad223b6344d484f92462521bb2;hpb=c3235553ddc2bb5965f6fe00e750cfe4aac9ccdf;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Entries.php b/src/Wallabag/CoreBundle/Entity/Entries.php index 3c061a37..ab5b859b 100644 --- a/src/Wallabag/CoreBundle/Entity/Entries.php +++ b/src/Wallabag/CoreBundle/Entity/Entries.php @@ -10,6 +10,7 @@ use Symfony\Component\Validator\Constraints as Assert; * * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntriesRepository") * @ORM\Table(name="entries") + * @ORM\HasLifecycleCallbacks() * */ class Entries @@ -19,9 +20,9 @@ class Entries * * @ORM\Column(name="id", type="integer", nullable=true) * @ORM\Id - * @ORM\GeneratedValue(strategy="IDENTITY") + * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private $id = null; /** * @var string @@ -39,18 +40,25 @@ class Entries private $url; /** - * @var string + * @var boolean * - * @ORM\Column(name="is_read", type="decimal", precision=10, scale=0, nullable=true) + * @ORM\Column(name="is_read", type="boolean", nullable=true, options={"default" = false}) */ - private $isRead = '0'; + private $isRead = false; /** - * @var string + * @var boolean + * + * @ORM\Column(name="is_fav", type="boolean", nullable=true, options={"default" = false}) + */ + private $isFav = false; + + /** + * @var boolean * - * @ORM\Column(name="is_fav", type="decimal", precision=10, scale=0, nullable=true) + * @ORM\Column(name="is_deleted", type="boolean", nullable=true, options={"default" = false}) */ - private $isFav = '0'; + private $isDeleted = false; /** * @var string @@ -59,6 +67,20 @@ class Entries */ private $content; + /** + * @var date + * + * @ORM\Column(name="created_at", type="datetime", nullable=true) + */ + private $createdAt; + + /** + * @var date + * + * @ORM\Column(name="updated_at", type="datetime", nullable=true) + */ + private $updatedAt; + /** * @var string * @@ -66,12 +88,45 @@ class Entries */ 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 + * @return integer */ public function getId() { @@ -81,7 +136,7 @@ class Entries /** * Set title * - * @param string $title + * @param string $title * @return Entries */ public function setTitle($title) @@ -94,7 +149,7 @@ class Entries /** * Get title * - * @return string + * @return string */ public function getTitle() { @@ -104,7 +159,7 @@ class Entries /** * Set url * - * @param string $url + * @param string $url * @return Entries */ public function setUrl($url) @@ -117,7 +172,7 @@ class Entries /** * Get url * - * @return string + * @return string */ public function getUrl() { @@ -127,10 +182,10 @@ class Entries /** * Set isRead * - * @param string $isRead + * @param string $isRead * @return Entries */ - public function setIsRead($isRead) + public function setRead($isRead) { $this->isRead = $isRead; @@ -140,9 +195,9 @@ class Entries /** * Get isRead * - * @return string + * @return string */ - public function getIsRead() + public function isRead() { return $this->isRead; } @@ -150,16 +205,17 @@ class Entries public function toggleArchive() { $this->isRead = $this->getIsRead() ^ 1; + return $this; } /** * Set isFav * - * @param string $isFav + * @param string $isFav * @return Entries */ - public function setIsFav($isFav) + public function setFav($isFav) { $this->isFav = $isFav; @@ -169,9 +225,9 @@ class Entries /** * Get isFav * - * @return string + * @return string */ - public function getIsFav() + public function isFav() { return $this->isFav; } @@ -186,7 +242,7 @@ class Entries /** * Set content * - * @param string $content + * @param string $content * @return Entries */ public function setContent($content) @@ -199,7 +255,7 @@ class Entries /** * Get content * - * @return string + * @return string */ public function getContent() { @@ -209,7 +265,7 @@ class Entries /** * Set userId * - * @param string $userId + * @param string $userId * @return Entries */ public function setUserId($userId) @@ -222,10 +278,140 @@ class Entries /** * Get userId * - * @return string + * @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; + } + + /** + * @param mixed $createdAt + * @ORM\PrePersist + */ + public function setCreatedAt() + { + $this->createdAt = new \DateTime(); + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->updatedAt; + } + + /** + * @param string $updatedAt + * @ORM\PreUpdate + */ + public function setUpdatedAt() + { + $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; + } }