]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
store estimated reading time / filters on reading time
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index f139bbacc0ce80500249e2d7dd956cd7de93beec..9aebc55bff454b79f15a3eb5c37b031e8385428a 100644 (file)
@@ -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\Helper\Tools;
 
 /**
  * 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;
 
@@ -264,6 +265,7 @@ class Entry
     public function setContent($content)
     {
         $this->content = $content;
+        $this->readingTime = Tools::getReadingTime($content);
 
         return $this;
     }