1 |
93413904
|
Jan Šedivý
|
<?php
|
2 |
|
|
|
3 |
|
|
namespace App\AdminModule\Presenters;
|
4 |
|
|
|
5 |
|
|
|
6 |
8b71ca4d
|
Jan Šedivý
|
use App\AdminModule\Components\ISurfaceTypeEditFormFactory;
|
7 |
93413904
|
Jan Šedivý
|
use App\AdminModule\Components\ISurfaceTypeGridFactory;
|
8 |
|
|
|
9 |
|
|
class SurfacePresenter extends BaseAdminPresenter
|
10 |
|
|
{
|
11 |
|
|
/** @var ISurfaceTypeGridFactory */
|
12 |
|
|
private $surfaceTypeGridFactory;
|
13 |
|
|
|
14 |
8b71ca4d
|
Jan Šedivý
|
/** @var ISurfaceTypeEditFormFactory */
|
15 |
|
|
private $surfaceTypeEditFormFactory;
|
16 |
|
|
|
17 |
93413904
|
Jan Šedivý
|
private $typeId;
|
18 |
|
|
|
19 |
|
|
/**
|
20 |
|
|
* SurfacePresenter constructor.
|
21 |
|
|
* @param ISurfaceTypeGridFactory $surfaceTypeGridFactory
|
22 |
8b71ca4d
|
Jan Šedivý
|
* @param ISurfaceTypeEditFormFactory $surfaceTypeEditFormFactory
|
23 |
93413904
|
Jan Šedivý
|
*/
|
24 |
8b71ca4d
|
Jan Šedivý
|
public function __construct(
|
25 |
|
|
ISurfaceTypeGridFactory $surfaceTypeGridFactory,
|
26 |
|
|
ISurfaceTypeEditFormFactory $surfaceTypeEditFormFactory
|
27 |
|
|
)
|
28 |
93413904
|
Jan Šedivý
|
{
|
29 |
|
|
parent::__construct();
|
30 |
|
|
|
31 |
|
|
$this->surfaceTypeGridFactory = $surfaceTypeGridFactory;
|
32 |
8b71ca4d
|
Jan Šedivý
|
$this->surfaceTypeEditFormFactory = $surfaceTypeEditFormFactory;
|
33 |
93413904
|
Jan Šedivý
|
}
|
34 |
|
|
|
35 |
|
|
public function actionAddType()
|
36 |
|
|
{
|
37 |
|
|
|
38 |
|
|
}
|
39 |
|
|
|
40 |
8b71ca4d
|
Jan Šedivý
|
public function actionEditType(int $id)
|
41 |
93413904
|
Jan Šedivý
|
{
|
42 |
8b71ca4d
|
Jan Šedivý
|
$this->typeId = $id;
|
43 |
93413904
|
Jan Šedivý
|
}
|
44 |
|
|
|
45 |
8b71ca4d
|
Jan Šedivý
|
public function actionDeleteType(int $id)
|
46 |
93413904
|
Jan Šedivý
|
{
|
47 |
|
|
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
public function createComponentSurfaceTypeGrid()
|
51 |
|
|
{
|
52 |
|
|
return $this->surfaceTypeGridFactory->create();
|
53 |
|
|
}
|
54 |
8b71ca4d
|
Jan Šedivý
|
|
55 |
|
|
public function createComponentSurfaceTypeEditForm()
|
56 |
|
|
{
|
57 |
|
|
return $this->surfaceTypeEditFormFactory->create($this->typeId);
|
58 |
|
|
}
|
59 |
93413904
|
Jan Šedivý
|
}
|