Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
PageControllerBase | |
100.00% |
5 / 5 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
isLoggedIn | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
viewWithController | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getSkipBaseName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Controllers\Page; |
6 | |
7 | use PeServer\App\Models\SessionKey; |
8 | use PeServer\Core\Mvc\Template\TemplateParameter; |
9 | use PeServer\Core\Mvc\ControllerArgument; |
10 | use PeServer\Core\Mvc\Result\ViewActionResult; |
11 | use PeServer\App\Controllers\DomainControllerBase; |
12 | use PeServer\App\Models\Domain\Page\PageLogicBase; |
13 | |
14 | /** |
15 | * [PAGE] ページ基底コントローラ。 |
16 | */ |
17 | abstract class PageControllerBase extends DomainControllerBase |
18 | { |
19 | protected function __construct(ControllerArgument $argument) |
20 | { |
21 | parent::__construct($argument); |
22 | } |
23 | |
24 | #region function |
25 | |
26 | /** |
27 | * ログイン済みか。 |
28 | * |
29 | * @return boolean ログイン済み。 |
30 | */ |
31 | final protected function isLoggedIn(): bool |
32 | { |
33 | return $this->stores->session->tryGet(SessionKey::ACCOUNT, $unused); |
34 | } |
35 | |
36 | protected function viewWithController(string $controllerName, string $action, TemplateParameter $parameter): ViewActionResult |
37 | { |
38 | $parameter->values[PageLogicBase::TEMP_MESSAGES] = $this->stores->temporary->pop(PageLogicBase::TEMP_MESSAGES); |
39 | |
40 | return parent::viewWithController($controllerName, $action, $parameter); |
41 | } |
42 | |
43 | #endregion |
44 | |
45 | #region DomainControllerBase |
46 | |
47 | protected function getSkipBaseName(): string |
48 | { |
49 | return __NAMESPACE__; |
50 | } |
51 | |
52 | #endregion |
53 | } |