Add backend classes for fetching inconsistent data
[MAILPOET-1587]
This commit is contained in:
committed by
Aschepikov
parent
22ee156dcd
commit
54c21df3a6
@@ -0,0 +1,23 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Util\DataInconsistency;
|
||||
|
||||
class DataInconsistencyController {
|
||||
const ORPHANED_TASKS = 'orphaned_tasks';
|
||||
|
||||
private DataInconsistencyRepository $repository;
|
||||
|
||||
public function __construct(
|
||||
DataInconsistencyRepository $repository
|
||||
) {
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function getInconsistentDataStatus(): array {
|
||||
$result = [
|
||||
self::ORPHANED_TASKS => $this->repository->getOrphanedSendingTasksCount(),
|
||||
];
|
||||
$result['total'] = array_sum($result);
|
||||
return $result;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user