]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
move some files to UserBundle
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index 7d2d2027f1bbf43478db1887339a2ed8a38cef56..4fd74001b3efc076388f183fe794fea6180fba04 100644 (file)
@@ -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\UserBundle\Entity\User;
 
 /**
  * Entry.
@@ -94,6 +94,13 @@ class Entry
      */
     private $mimetype;
 
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="language", type="text", nullable=true)
+     */
+    private $language;
+
     /**
      * @var int
      *
@@ -108,6 +115,13 @@ class Entry
      */
     private $domainName;
 
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="preview_picture", type="text", nullable=true)
+     */
+    private $previewPicture;
+
     /**
      * @var bool
      *
@@ -116,7 +130,7 @@ class Entry
     private $isPublic;
 
     /**
-     * @ORM\ManyToOne(targetEntity="User", inversedBy="entries")
+     * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="entries")
      */
     private $user;
 
@@ -129,7 +143,7 @@ class Entry
     /*
      * @param User     $user
      */
-    public function __construct(User $user)
+    public function __construct(\Wallabag\UserBundle\Entity\User $user)
     {
         $this->user = $user;
         $this->tags = new ArrayCollection();
@@ -265,8 +279,6 @@ class Entry
     public function setContent($content)
     {
         $this->content = $content;
-        $this->readingTime = Tools::getReadingTime($content);
-        $this->domainName = parse_url($this->url, PHP_URL_HOST);
 
         return $this;
     }
@@ -419,4 +431,52 @@ 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;
+    }
+
+    /**
+     * Set language.
+     *
+     * @param string $language
+     *
+     * @return Entry
+     */
+    public function setLanguage($language)
+    {
+        $this->language = $language;
+
+        return $this;
+    }
+
+    /**
+     * Get language.
+     *
+     * @return string
+     */
+    public function getLanguage()
+    {
+        return $this->language;
+    }
 }