mirror of
https://github.com/wallabag/wallabag.git
synced 2024-09-25 13:00:12 +00:00
7019c7cf6c
- 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
34 lines
577 B
PHP
34 lines
577 B
PHP
<?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;
|
|
}
|
|
}
|