aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/ImportChain.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-12-31 11:24:46 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-01-02 23:27:41 +0100
commit7019c7cf6c6af39c0f458769e20c3f9306477943 (patch)
tree12acceaa458cdf6d24367eba85f690265acddcdb /src/Wallabag/ImportBundle/Import/ImportChain.php
parentb1d05721cf37ab94ec1a6837fe79cf19474dd0ff (diff)
downloadwallabag-7019c7cf6c6af39c0f458769e20c3f9306477943.tar.gz
wallabag-7019c7cf6c6af39c0f458769e20c3f9306477943.tar.zst
wallabag-7019c7cf6c6af39c0f458769e20c3f9306477943.zip
Add tagged services for import
- list services in /import - add url to import service - ImportBundle routing are now prefixed by /import - optimize flush in each import (flushing each 20 contents) - improve design of each import - add more tests
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/ImportChain.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/ImportChain.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Import/ImportChain.php b/src/Wallabag/ImportBundle/Import/ImportChain.php
new file mode 100644
index 00000000..9dd77956
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Import/ImportChain.php
@@ -0,0 +1,34 @@
1<?php
2
3namespace Wallabag\ImportBundle\Import;
4
5class ImportChain
6{
7 private $imports;
8
9 public function __construct()
10 {
11 $this->imports = [];
12 }
13
14 /**
15 * Add an import to the chain.
16 *
17 * @param ImportInterface $import
18 * @param string $alias
19 */
20 public function addImport(ImportInterface $import, $alias)
21 {
22 $this->imports[$alias] = $import;
23 }
24
25 /**
26 * Get all imports.
27 *
28 * @return array<ImportInterface>
29 */
30 public function getAll()
31 {
32 return $this->imports;
33 }
34}