Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
17 / 17 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
AccountUserLogic | |
100.00% |
17 / 17 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
validateImpl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
executeImpl | |
100.00% |
15 / 15 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Domain\Page\Account; |
6 | |
7 | use PeServer\Core\Text; |
8 | use PeServer\Core\Mvc\LogicCallMode; |
9 | use PeServer\Core\Mvc\LogicParameter; |
10 | use PeServer\App\Models\SessionKey; |
11 | use PeServer\App\Models\AppCryptography; |
12 | use PeServer\App\Models\Domain\Page\PageLogicBase; |
13 | use PeServer\App\Models\Dao\Entities\UsersEntityDao; |
14 | use PeServer\App\Models\Dao\Entities\PluginsEntityDao; |
15 | use PeServer\Core\Collection\Arr; |
16 | |
17 | class AccountUserLogic extends PageLogicBase |
18 | { |
19 | public function __construct(LogicParameter $parameter) |
20 | { |
21 | parent::__construct($parameter); |
22 | } |
23 | |
24 | #region PageLogicBase |
25 | |
26 | protected function validateImpl(LogicCallMode $callMode): void |
27 | { |
28 | //NOP |
29 | } |
30 | |
31 | protected function executeImpl(LogicCallMode $callMode): void |
32 | { |
33 | $userInfo = $this->requireSession(SessionKey::ACCOUNT); |
34 | |
35 | $database = $this->openDatabase(); |
36 | |
37 | $usersEntityDao = new UsersEntityDao($database); |
38 | $pluginsEntityDao = new PluginsEntityDao($database); |
39 | |
40 | $userInfoData = $usersEntityDao->selectUserInfoData($userInfo->userId); |
41 | $userPlugins = $pluginsEntityDao->selectPluginByUserId($userInfo->userId); |
42 | |
43 | $map = [ |
44 | 'user_id' => 'account_user_id', |
45 | 'login_id' => 'account_user_login_id', |
46 | 'level' => 'account_user_level', |
47 | 'name' => 'account_user_name', |
48 | 'website' => 'account_user_website', |
49 | ]; |
50 | |
51 | $this->setValue('user', $userInfoData); |
52 | $this->setValue('plugins', $userPlugins->rows); |
53 | } |
54 | |
55 | #endregion |
56 | } |