diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/AbstractImport.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/AbstractImport.php | 52 |
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 | ||
3 | namespace Wallabag\ImportBundle\Import; | 3 | namespace Wallabag\ImportBundle\Import; |
4 | 4 | ||
5 | use Doctrine\ORM\EntityManager; | ||
6 | use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface; | ||
5 | use Psr\Log\LoggerInterface; | 7 | use Psr\Log\LoggerInterface; |
6 | use Psr\Log\NullLogger; | 8 | use Psr\Log\NullLogger; |
7 | use Doctrine\ORM\EntityManager; | 9 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
8 | use Wallabag\CoreBundle\Helper\ContentProxy; | ||
9 | use Wallabag\CoreBundle\Entity\Entry; | 10 | use Wallabag\CoreBundle\Entity\Entry; |
10 | use Wallabag\CoreBundle\Entity\Tag; | 11 | use Wallabag\CoreBundle\Entity\Tag; |
12 | use Wallabag\CoreBundle\Event\EntrySavedEvent; | ||
13 | use Wallabag\CoreBundle\Helper\ContentProxy; | ||
11 | use Wallabag\CoreBundle\Helper\TagsAssigner; | 14 | use Wallabag\CoreBundle\Helper\TagsAssigner; |
12 | use Wallabag\UserBundle\Entity\User; | 15 | use Wallabag\UserBundle\Entity\User; |
13 | use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface; | ||
14 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
15 | use Wallabag\CoreBundle\Event\EntrySavedEvent; | ||
16 | 16 | ||
17 | abstract class AbstractImport implements ImportInterface | 17 | abstract 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 | * |