-
Notifications
You must be signed in to change notification settings - Fork 9.4k
/
Copy pathContext.php
111 lines (100 loc) · 2.82 KB
/
Context.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
/**
* Abstract model context
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Model;
/**
* Constructor modification point for Magento\Framework\Model\AbstractModel.
*
* All context classes were introduced to allow for backwards compatible constructor modifications
* of classes that were supposed to be extended by extension developers.
*
* Do not call methods of this class directly.
*
* As Magento moves from inheritance-based APIs all such classes will be deprecated together with
* the classes they were introduced for.
*
* @api
* @since 100.0.2
*/
class Context implements \Magento\Framework\ObjectManager\ContextInterface
{
/**
* @var \Magento\Framework\Event\ManagerInterface
*/
protected $_eventDispatcher;
/**
* @var \Magento\Framework\App\CacheInterface
*/
protected $_cacheManager;
/**
* @var \Psr\Log\LoggerInterface
*/
protected $_logger;
/**
* @var \Magento\Framework\App\State
*/
protected $_appState;
/**
* @var \Magento\Framework\Model\ActionValidator\RemoveAction
*/
protected $_actionValidator;
/**
* @param \Psr\Log\LoggerInterface $logger
* @param \Magento\Framework\Event\ManagerInterface $eventDispatcher
* @param \Magento\Framework\App\CacheInterface $cacheManager
* @param \Magento\Framework\App\State $appState
* @param \Magento\Framework\Model\ActionValidator\RemoveAction $actionValidator
*/
public function __construct(
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Event\ManagerInterface $eventDispatcher,
\Magento\Framework\App\CacheInterface $cacheManager,
\Magento\Framework\App\State $appState,
\Magento\Framework\Model\ActionValidator\RemoveAction $actionValidator
) {
$this->_eventDispatcher = $eventDispatcher;
$this->_cacheManager = $cacheManager;
$this->_appState = $appState;
$this->_logger = $logger;
$this->_actionValidator = $actionValidator;
}
/**
* @return \Magento\Framework\App\CacheInterface
*/
public function getCacheManager()
{
return $this->_cacheManager;
}
/**
* @return \Magento\Framework\Event\ManagerInterface
*/
public function getEventDispatcher()
{
return $this->_eventDispatcher;
}
/**
* @return \Psr\Log\LoggerInterface
*/
public function getLogger()
{
return $this->_logger;
}
/**
* @return \Magento\Framework\App\State
*/
public function getAppState()
{
return $this->_appState;
}
/**
* @return \Magento\Framework\Model\ActionValidator\RemoveAction
*/
public function getActionValidator()
{
return $this->_actionValidator;
}
}