]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
Added index on table creation
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index f2da3f4def670d5a0e08af123a1617a2cb3fa509..8dcc719053667a9358dd093440d1cb2d224476a9 100644 (file)
@@ -19,7 +19,12 @@ use Wallabag\AnnotationBundle\Entity\Annotation;
  *
  * @XmlRoot("entry")
  * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository")
- * @ORM\Table(name="`entry`")
+ * @ORM\Table(
+ *     name="`entry`",
+ *     options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"},
+ *     indexes={@ORM\Index(name="created_at", columns={"created_at"})},
+ *     indexes={@ORM\Index(name="uuid", columns={"uuid"})}
+ * )
  * @ORM\HasLifecycleCallbacks()
  * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())")
  */
@@ -176,6 +181,15 @@ class Entry
      */
     private $isPublic;
 
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="http_status", type="string", length=3, nullable=true)
+     *
+     * @Groups({"entries_for_user", "export_all"})
+     */
+    private $httpStatus;
+
     /**
      * @Exclude
      *
@@ -190,10 +204,10 @@ class Entry
      * @ORM\JoinTable(
      *  name="entry_tag",
      *  joinColumns={
-     *      @ORM\JoinColumn(name="entry_id", referencedColumnName="id")
+     *      @ORM\JoinColumn(name="entry_id", referencedColumnName="id", onDelete="cascade")
      *  },
      *  inverseJoinColumns={
-     *      @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
+     *      @ORM\JoinColumn(name="tag_id", referencedColumnName="id", onDelete="cascade")
      *  }
      * )
      */
@@ -665,4 +679,24 @@ class Entry
     {
         $this->uuid = null;
     }
+
+    /**
+     * @return int
+     */
+    public function getHttpStatus()
+    {
+        return $this->httpStatus;
+    }
+
+    /**
+     * @param int $httpStatus
+     *
+     * @return Entry
+     */
+    public function setHttpStatus($httpStatus)
+    {
+        $this->httpStatus = $httpStatus;
+
+        return $this;
+    }
 }