aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/AbstractImport.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/AbstractImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/AbstractImport.php52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php
index 9b624296..cb46db09 100644
--- a/src/Wallabag/ImportBundle/Import/AbstractImport.php
+++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php
@@ -2,17 +2,17 @@
2 2
3namespace Wallabag\ImportBundle\Import; 3namespace Wallabag\ImportBundle\Import;
4 4
5use Doctrine\ORM\EntityManager;
6use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface;
5use Psr\Log\LoggerInterface; 7use Psr\Log\LoggerInterface;
6use Psr\Log\NullLogger; 8use Psr\Log\NullLogger;
7use Doctrine\ORM\EntityManager; 9use Symfony\Component\EventDispatcher\EventDispatcherInterface;
8use Wallabag\CoreBundle\Helper\ContentProxy;
9use Wallabag\CoreBundle\Entity\Entry; 10use Wallabag\CoreBundle\Entity\Entry;
10use Wallabag\CoreBundle\Entity\Tag; 11use Wallabag\CoreBundle\Entity\Tag;
12use Wallabag\CoreBundle\Event\EntrySavedEvent;
13use Wallabag\CoreBundle\Helper\ContentProxy;
11use Wallabag\CoreBundle\Helper\TagsAssigner; 14use Wallabag\CoreBundle\Helper\TagsAssigner;
12use Wallabag\UserBundle\Entity\User; 15use Wallabag\UserBundle\Entity\User;
13use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface;
14use Symfony\Component\EventDispatcher\EventDispatcherInterface;
15use Wallabag\CoreBundle\Event\EntrySavedEvent;
16 16
17abstract class AbstractImport implements ImportInterface 17abstract class AbstractImport implements ImportInterface
18{ 18{
@@ -98,6 +98,27 @@ abstract class AbstractImport implements ImportInterface
98 } 98 }
99 99
100 /** 100 /**
101 * {@inheritdoc}
102 */
103 public function getSummary()
104 {
105 return [
106 'skipped' => $this->skippedEntries,
107 'imported' => $this->importedEntries,
108 'queued' => $this->queuedEntries,
109 ];
110 }
111
112 /**
113 * Parse one entry.
114 *
115 * @param array $importedEntry
116 *
117 * @return Entry
118 */
119 abstract public function parseEntry(array $importedEntry);
120
121 /**
101 * Fetch content from the ContentProxy (using graby). 122 * Fetch content from the ContentProxy (using graby).
102 * If it fails return the given entry to be saved in all case (to avoid user to loose the content). 123 * If it fails return the given entry to be saved in all case (to avoid user to loose the content).
103 * 124 *
@@ -196,27 +217,6 @@ abstract class AbstractImport implements ImportInterface
196 } 217 }
197 218
198 /** 219 /**
199 * {@inheritdoc}
200 */
201 public function getSummary()
202 {
203 return [
204 'skipped' => $this->skippedEntries,
205 'imported' => $this->importedEntries,
206 'queued' => $this->queuedEntries,
207 ];
208 }
209
210 /**
211 * Parse one entry.
212 *
213 * @param array $importedEntry
214 *
215 * @return Entry
216 */
217 abstract public function parseEntry(array $importedEntry);
218
219 /**
220 * Set current imported entry to archived / read. 220 * Set current imported entry to archived / read.
221 * Implementation is different accross all imports. 221 * Implementation is different accross all imports.
222 * 222 *