Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
12 / 12 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
PeSettingEntityDao | |
100.00% |
12 / 12 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
selectPeSettingVersion | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
updatePeSettingVersion | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Dao\Entities; |
6 | |
7 | use PeServer\Core\Database\DaoBase; |
8 | use PeServer\Core\Database\DaoTrait; |
9 | |
10 | class PeSettingEntityDao extends DaoBase |
11 | { |
12 | use DaoTrait; |
13 | |
14 | #region function |
15 | |
16 | public function selectPeSettingVersion(): string |
17 | { |
18 | $result = $this->context->querySingle( |
19 | <<<SQL |
20 | |
21 | select |
22 | pe_setting.version |
23 | from |
24 | pe_setting |
25 | |
26 | SQL |
27 | ); |
28 | |
29 | return $result->fields['version']; |
30 | } |
31 | |
32 | public function updatePeSettingVersion(string $version): void |
33 | { |
34 | $this->context->updateByKey( |
35 | <<<SQL |
36 | |
37 | update |
38 | pe_setting |
39 | set |
40 | version = :version |
41 | |
42 | SQL, |
43 | [ |
44 | 'version' => $version, |
45 | ] |
46 | ); |
47 | } |
48 | |
49 | #endregion |
50 | } |