1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Kunstmaan\NodeBundle\Event; |
4
|
|
|
|
5
|
|
|
use Kunstmaan\AdminBundle\Event\BcEvent; |
6
|
|
|
use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\TabPane; |
7
|
|
|
use Kunstmaan\NodeBundle\Entity\HasNodeInterface; |
8
|
|
|
use Kunstmaan\NodeBundle\Entity\Node; |
9
|
|
|
use Kunstmaan\NodeBundle\Entity\NodeTranslation; |
10
|
|
|
use Kunstmaan\NodeBundle\Entity\NodeVersion; |
11
|
|
|
use Symfony\Component\HttpFoundation\Request; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* The event to pass metadata if the adaptForm event is triggered |
15
|
|
|
*/ |
16
|
|
|
class AdaptFormEvent extends BcEvent |
17
|
|
|
{ |
18
|
|
|
/** |
19
|
|
|
* @var TabPane |
20
|
|
|
*/ |
21
|
|
|
private $tabPane; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var |
25
|
|
|
*/ |
26
|
|
|
private $page; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var Node |
30
|
|
|
*/ |
31
|
|
|
private $node; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var NodeTranslation |
35
|
|
|
*/ |
36
|
|
|
private $nodeTranslation; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var NodeVersion |
40
|
|
|
*/ |
41
|
|
|
private $nodeVersion; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var Request |
45
|
|
|
*/ |
46
|
|
|
private $request; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @param Request $request |
50
|
|
|
* @param TabPane $tabPane The tab pane |
51
|
|
|
* @param HasNodeInterface $page The page |
52
|
|
|
* @param Node $node The node |
53
|
|
|
* @param NodeTranslation $nodeTranslation The node translation |
54
|
|
|
* @param NodeVersion $nodeVersion The node version |
55
|
|
|
*/ |
56
|
2 |
|
public function __construct(Request $request, TabPane $tabPane, $page = null, Node $node = null, NodeTranslation $nodeTranslation = null, NodeVersion $nodeVersion = null) |
|
|
|
|
57
|
|
|
{ |
58
|
2 |
|
$this->request = $request; |
59
|
2 |
|
$this->tabPane = $tabPane; |
60
|
2 |
|
$this->page = $page; |
61
|
2 |
|
$this->node = $node; |
62
|
2 |
|
$this->nodeTranslation = $nodeTranslation; |
63
|
2 |
|
$this->nodeVersion = $nodeVersion; |
64
|
2 |
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return Node |
68
|
|
|
*/ |
69
|
1 |
|
public function getNode() |
70
|
|
|
{ |
71
|
1 |
|
return $this->node; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return NodeTranslation |
76
|
|
|
*/ |
77
|
1 |
|
public function getNodeTranslation() |
78
|
|
|
{ |
79
|
1 |
|
return $this->nodeTranslation; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return NodeVersion |
84
|
|
|
*/ |
85
|
1 |
|
public function getNodeVersion() |
86
|
|
|
{ |
87
|
1 |
|
return $this->nodeVersion; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return |
92
|
|
|
*/ |
93
|
2 |
|
public function getPage() |
94
|
|
|
{ |
95
|
2 |
|
return $this->page; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return TabPane |
100
|
|
|
*/ |
101
|
2 |
|
public function getTabPane() |
102
|
|
|
{ |
103
|
2 |
|
return $this->tabPane; |
104
|
|
|
} |
105
|
|
|
|
106
|
1 |
|
public function getRequest() |
107
|
|
|
{ |
108
|
1 |
|
return $this->request; |
109
|
|
|
} |
110
|
|
|
} |
111
|
|
|
|