X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FEntry.php;h=365030c7b8b79bcb85e3de039866d5fb57606fad;hb=e8911f7c09fa9d8009d7c7ee9fb0c181d2ffbc31;hp=7276b437cd01e8503507515003e15e1c5fcb04af;hpb=8527238846b0ea307ba68ca8a831eb0884c68d4a;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 7276b437..365030c7 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -121,6 +121,24 @@ class Entry */ private $updatedAt; + /** + * @var \DateTime + * + * @ORM\Column(name="published_at", type="datetime", nullable=true) + * + * @Groups({"entries_for_user", "export_all"}) + */ + private $publishedAt; + + /** + * @var array + * + * @ORM\Column(name="published_by", type="array", nullable=true) + * + * @Groups({"entries_for_user", "export_all"}) + */ + private $publishedBy; + /** * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"}) * @ORM\JoinTable @@ -175,22 +193,22 @@ class Entry private $previewPicture; /** - * @var bool + * @var string * - * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false}) + * @ORM\Column(name="http_status", type="string", length=3, nullable=true) * - * @Groups({"export_all"}) + * @Groups({"entries_for_user", "export_all"}) */ - private $isPublic; + private $httpStatus; /** - * @var string + * @var array * - * @ORM\Column(name="http_status", type="string", length=3, nullable=true) + * @ORM\Column(name="headers", type="array", nullable=true) * * @Groups({"entries_for_user", "export_all"}) */ - private $httpStatus; + private $headers; /** * @Exclude @@ -532,23 +550,7 @@ class Entry } /** - * @return bool - */ - public function isPublic() - { - return $this->isPublic; - } - - /** - * @param bool $isPublic - */ - public function setIsPublic($isPublic) - { - $this->isPublic = $isPublic; - } - - /** - * @return ArrayCollection + * @return ArrayCollection */ public function getTags() { @@ -683,7 +685,17 @@ class Entry } /** - * @return int + * Used in the entries filter so it's more explicit for the end user than the uid. + * + * @return bool + */ + public function isPublic() + { + return null !== $this->uid; + } + + /** + * @return string */ public function getHttpStatus() { @@ -691,7 +703,7 @@ class Entry } /** - * @param int $httpStatus + * @param string $httpStatus * * @return Entry */ @@ -701,4 +713,64 @@ class Entry return $this; } + + /** + * @return \Datetime + */ + public function getPublishedAt() + { + return $this->publishedAt; + } + + /** + * @param \Datetime $publishedAt + * + * @return Entry + */ + public function setPublishedAt(\Datetime $publishedAt) + { + $this->publishedAt = $publishedAt; + + return $this; + } + + /** + * @return array + */ + public function getPublishedBy() + { + return $this->publishedBy; + } + + /** + * @param array $publishedBy + * + * @return Entry + */ + public function setPublishedBy($publishedBy) + { + $this->publishedBy = $publishedBy; + + return $this; + } + + /** + * @return array + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * @param array $headers + * + * @return Entry + */ + public function setHeaders($headers) + { + $this->headers = $headers; + + return $this; + } }