37 private $_objectManager;
42 private $deploymentConfig;
47 private $_frontendPool;
52 private $_typeFrontendMap;
57 private $_instances = [];
69 array $typeFrontendMap = []
73 $this->_frontendPool = $frontendPool;
74 $this->_typeFrontendMap = $typeFrontendMap;
83 public function get($cacheType)
85 if (!isset($this->_instances[$cacheType])) {
87 $frontendInstance = $this->_frontendPool->get($frontendId);
89 $frontendInstance = $this->_objectManager->create(
91 [
'frontend' => $frontendInstance,
'identifier' => $cacheType]
93 $this->_instances[$cacheType] = $frontendInstance;
95 return $this->_instances[$cacheType];
107 $cacheInfo = $this->deploymentConfig->getConfigData(self::KEY_CACHE);
108 if (
null !== $cacheInfo) {
109 $result = isset($cacheInfo[self::KEY_CACHE_TYPE][$cacheType][self::KEY_FRONTEND_CACHE]) ?
113 if (isset($this->_typeFrontendMap[$cacheType])) {
114 $result = $this->_typeFrontendMap[$cacheType];
_getCacheFrontendId($cacheType)
const DEFAULT_FRONTEND_ID
__construct(\Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\App\DeploymentConfig $deploymentConfig, \Magento\Framework\App\Cache\Frontend\Pool $frontendPool, array $typeFrontendMap=[])