X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FEntry.php;h=e684c9b103f77189b6d799549c2fabd33561fe9e;hb=a1413a3da9e845a0f2e00e73069f5363864367bd;hp=f139bbacc0ce80500249e2d7dd956cd7de93beec;hpb=9b9b05008a96a45bbf6da4c0c1c1b1244b83c6af;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index f139bbac..e684c9b1 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -7,6 +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\Tools\Utils; /** * Entry. @@ -96,7 +97,7 @@ class Entry /** * @var int * - * @ORM\Column(name="reading_type", type="integer", nullable=true) + * @ORM\Column(name="reading_time", type="integer", nullable=true) */ private $readingTime; @@ -107,6 +108,13 @@ class Entry */ private $domainName; + /** + * @var string + * + * @ORM\Column(name="preview_picture", type="text", nullable=true) + */ + private $previewPicture; + /** * @var bool * @@ -264,6 +272,8 @@ class Entry public function setContent($content) { $this->content = $content; + $this->readingTime = Utils::getReadingTime($content); + $this->domainName = parse_url($this->url, PHP_URL_HOST); return $this; } @@ -416,4 +426,28 @@ 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; + } }