|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace N98\Magento\Application\Console; |
|
4
|
|
|
|
|
5
|
|
|
use N98\Magento\Application; |
|
6
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
7
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
8
|
|
|
use Symfony\Component\EventDispatcher\Event as BaseEvent; |
|
9
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
|
10
|
|
|
|
|
11
|
|
|
class Event extends BaseEvent |
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* @var Application |
|
15
|
|
|
*/ |
|
16
|
|
|
protected $application; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @var InputInterface |
|
20
|
|
|
*/ |
|
21
|
|
|
protected $input; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* @var OutputInterface |
|
25
|
|
|
*/ |
|
26
|
|
|
protected $output; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var EventDispatcherInterface Dispatcher that dispatched this event |
|
30
|
|
|
*/ |
|
31
|
|
|
private $dispatcher; |
|
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
public function __construct(Application $application, InputInterface $input, OutputInterface $output) |
|
34
|
|
|
{ |
|
35
|
|
|
$this->application = $application; |
|
36
|
|
|
$this->input = $input; |
|
37
|
|
|
$this->output = $output; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* Gets the input instance. |
|
42
|
|
|
* |
|
43
|
|
|
* @return InputInterface An InputInterface instance |
|
44
|
|
|
*/ |
|
45
|
|
|
public function getInput() |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->input; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Gets the output instance. |
|
52
|
|
|
* |
|
53
|
|
|
* @return OutputInterface An OutputInterface instance |
|
54
|
|
|
*/ |
|
55
|
|
|
public function getOutput() |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->output; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @return Application |
|
62
|
|
|
*/ |
|
63
|
|
|
public function getApplication() |
|
64
|
|
|
{ |
|
65
|
|
|
return $this->application; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* Stores the EventDispatcher that dispatches this Event. |
|
70
|
|
|
* |
|
71
|
|
|
* @param EventDispatcherInterface $dispatcher |
|
72
|
|
|
* |
|
73
|
|
|
* @deprecated since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. |
|
74
|
|
|
*/ |
|
75
|
|
|
public function setDispatcher(EventDispatcherInterface $dispatcher) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->dispatcher = $dispatcher; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Returns the EventDispatcher that dispatches this Event. |
|
82
|
|
|
* |
|
83
|
|
|
* @return EventDispatcherInterface |
|
84
|
|
|
* |
|
85
|
|
|
* @deprecated since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. |
|
86
|
|
|
*/ |
|
87
|
|
|
public function getDispatcher() |
|
88
|
|
|
{ |
|
89
|
|
|
return $this->dispatcher; |
|
90
|
|
|
} |
|
91
|
|
|
} |
|
92
|
|
|
|