forked from wallabag/wallabag
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
This commit is contained in:
34
src/Wallabag/ImportBundle/Import/ImportChain.php
Normal file
34
src/Wallabag/ImportBundle/Import/ImportChain.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Import;
|
||||
|
||||
class ImportChain
|
||||
{
|
||||
private $imports;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->imports = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an import to the chain.
|
||||
*
|
||||
* @param ImportInterface $import
|
||||
* @param string $alias
|
||||
*/
|
||||
public function addImport(ImportInterface $import, $alias)
|
||||
{
|
||||
$this->imports[$alias] = $import;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all imports.
|
||||
*
|
||||
* @return array<ImportInterface>
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
return $this->imports;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user