Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
AdministratorApiCacheRebuildLogic
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 validateImpl
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 executeImpl
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace PeServer\App\Models\Domain\Api\AdministratorApi;
6
7use PeServer\App\Models\AppDatabaseCache;
8use PeServer\App\Models\AuditLog;
9use PeServer\App\Models\Domain\Api\ApiLogicBase;
10use PeServer\App\Models\Domain\AppArchiver;
11use PeServer\App\Models\ResponseJson;
12use PeServer\Core\Mvc\LogicCallMode;
13use PeServer\Core\Mvc\LogicParameter;
14
15class AdministratorApiCacheRebuildLogic extends ApiLogicBase
16{
17    public function __construct(LogicParameter $parameter, private AppDatabaseCache $dbCache)
18    {
19        parent::__construct($parameter);
20    }
21
22    #region ApiLogicBase
23
24    protected function validateImpl(LogicCallMode $callMode): void
25    {
26        //NOP
27    }
28
29    protected function executeImpl(LogicCallMode $callMode): void
30    {
31        $executedItems = $this->dbCache->exportAll();
32
33        $this->writeAuditLogCurrentUser(AuditLog::API_ADMINISTRATOR_CACHE_REBUILD, $executedItems);
34
35        $this->setResponseJson(ResponseJson::success($executedItems));
36    }
37
38    #endregion
39}