Add backend classes for fetching inconsistent data

[MAILPOET-1587]
This commit is contained in:
Rostislav Wolny
2024-07-31 14:28:34 +02:00
committed by Aschepikov
parent 22ee156dcd
commit 54c21df3a6
4 changed files with 87 additions and 0 deletions

View File

@@ -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;
}
}