X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FEntry.php;h=5e3f9a37a6bc89f4604de1d623f039a927993877;hb=fad316151c282b2383fae751f7ca45373f1f26ed;hp=9aebc55bff454b79f15a3eb5c37b031e8385428a;hpb=496f21e6faed1d06623221dabb35d1f3ce8fc8c2;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 9aebc55b..5e3f9a37 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; use Hateoas\Configuration\Annotation as Hateoas; use JMS\Serializer\Annotation\XmlRoot; -use Wallabag\CoreBundle\Helper\Tools; +use Wallabag\CoreBundle\Tools\Utils; /** * Entry. @@ -108,6 +108,13 @@ class Entry */ private $domainName; + /** + * @var string + * + * @ORM\Column(name="preview_picture", type="text", nullable=true) + */ + private $previewPicture; + /** * @var bool * @@ -265,7 +272,8 @@ class Entry public function setContent($content) { $this->content = $content; - $this->readingTime = Tools::getReadingTime($content); + $this->readingTime = Utils::getReadingTime($content); + $this->domainName = parse_url($this->url, PHP_URL_HOST); return $this; } @@ -418,4 +426,29 @@ class Entry { $this->tags->removeElement($tag); } + + /** + * Set previewPicture + * + * @param string $previewPicture + * + * @return Entry + */ + public function setPreviewPicture($previewPicture) + { + $this->previewPicture = $previewPicture; + + return $this; + } + + /** + * Get previewPicture + * + * @return string + */ + public function getPreviewPicture() + { + return $this->previewPicture; + } + }