]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/EntriesExport.php
Fix relations export for Entry
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / EntriesExport.php
index 1dfa12c8bf99480e967f40a58be5d4e9fadc4a83..d1f1e23354480e9d24fe07134ea2b15071f39eba 100644 (file)
@@ -25,7 +25,7 @@ class EntriesExport
     private $footerTemplate = '<div style="text-align:center;">
         <p>Produced by wallabag with %EXPORT_METHOD%</p>
         <p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p>
-        </div';
+        </div>';
 
     /**
      * @param Config $craueConfig CraueConfig instance to get wallabag instance url from database
@@ -53,10 +53,6 @@ class EntriesExport
 
         $this->entries = $entries;
 
-        foreach ($entries as $entry) {
-            $this->tags[] = $entry->getTags();
-        }
-
         return $this;
     }
 
@@ -159,8 +155,8 @@ class EntriesExport
 
         // set tags as subjects
         foreach ($this->entries as $entry) {
-            foreach ($this->tags as $tag) {
-                $book->setSubject($tag['value']);
+            foreach ($entry->getTags() as $tag) {
+                $book->setSubject($tag->getLabel());
             }
 
             // the reader in Kobo Devices doesn't likes special caracters
@@ -265,8 +261,8 @@ class EntriesExport
          * Adding actual entries
          */
         foreach ($this->entries as $entry) {
-            foreach ($this->tags as $tag) {
-                $pdf->SetKeywords($tag['value']);
+            foreach ($entry->getTags() as $tag) {
+                $pdf->SetKeywords($tag->getLabel());
             }
 
             $pdf->AddPage();