forked from wallabag/wallabag
Add availability to disable an importer
This commit is contained in:
@ -21,6 +21,7 @@ abstract class AbstractImport implements ImportInterface
|
||||
protected $skippedEntries = 0;
|
||||
protected $importedEntries = 0;
|
||||
protected $queuedEntries = 0;
|
||||
protected $enabled = true;
|
||||
|
||||
public function __construct(
|
||||
protected EntityManagerInterface $em,
|
||||
@ -74,6 +75,25 @@ abstract class AbstractImport implements ImportInterface
|
||||
return $this->markAsRead;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether the import is enabled.
|
||||
* If not, the importer won't be available in the UI.
|
||||
*/
|
||||
public function isEnabled(): bool
|
||||
{
|
||||
return $this->enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether the import is enabled.
|
||||
*/
|
||||
public function setEnabled(bool $enabled): static
|
||||
{
|
||||
$this->enabled = $enabled;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether articles should be fetched for updated content.
|
||||
*
|
||||
|
||||
@ -18,7 +18,11 @@ class ImportChain
|
||||
*/
|
||||
public function addImport(ImportInterface $import, $alias)
|
||||
{
|
||||
// if (true === $import->isEnabled()) {
|
||||
$this->imports[$alias] = $import;
|
||||
|
||||
// }
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -63,4 +63,15 @@ interface ImportInterface extends LoggerAwareInterface
|
||||
* @param bool $markAsRead
|
||||
*/
|
||||
public function setMarkAsRead($markAsRead): static;
|
||||
|
||||
/**
|
||||
* Get whether the import is enabled.
|
||||
* If not, the importer won't be available in the UI.
|
||||
*/
|
||||
public function isEnabled(): bool;
|
||||
|
||||
/**
|
||||
* Set whether the import is enabled.
|
||||
*/
|
||||
public function setEnabled(bool $enabled): static;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user