Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-page-cache
Observer
FlushAllCache.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\PageCache\Observer
;
8
9
use
Magento\Framework\App\ObjectManager
;
10
use
Magento\Framework\Event\ObserverInterface
;
11
12
class
FlushAllCache
implements
ObserverInterface
13
{
19
protected
$_cache
;
20
26
protected
$_config
;
27
31
private
$fullPageCache;
32
37
public
function
__construct
(\
Magento
\PageCache\Model\Config
$config
, \
Magento
\Framework\
App
\PageCache\Cache
$cache
)
38
{
39
$this->_config =
$config
;
40
$this->_cache =
$cache
;
41
}
42
49
public
function
execute
(\
Magento
\Framework\Event\Observer
$observer
)
50
{
51
if
($this->_config->getType() ==
\Magento\PageCache\Model\Config::BUILT_IN
) {
52
$this->getCache()->clean();
53
}
54
}
55
61
private
function
getCache()
62
{
63
if
(!$this->fullPageCache) {
64
$this->fullPageCache =
ObjectManager::getInstance
()->get(\
Magento
\PageCache\Model\Cache\Type::class);
65
}
66
return
$this->fullPageCache;
67
}
68
}
Magento\PageCache\Observer\FlushAllCache\$_config
$_config
Definition:
FlushAllCache.php:26
Magento\Framework\App
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
Magento\PageCache\Observer\FlushAllCache
Definition:
FlushAllCache.php:12
$config
$config
Definition:
fraud_order.php:17
Magento\Framework\Event\ObserverInterface
Definition:
ObserverInterface.php:16
Magento\PageCache\Observer
Definition:
FlushAllCache.php:7
Magento\PageCache\Observer\FlushAllCache\$_cache
$_cache
Definition:
FlushAllCache.php:19
Magento\PageCache\Observer\FlushAllCache\execute
execute(\Magento\Framework\Event\Observer $observer)
Definition:
FlushAllCache.php:49
Magento\Framework\App\ObjectManager
Definition:
ConfigCache.php:8
Magento\PageCache\Observer\FlushAllCache\__construct
__construct(\Magento\PageCache\Model\Config $config, \Magento\Framework\App\PageCache\Cache $cache)
Definition:
FlushAllCache.php:37
$observer
$observer
Definition:
second_website_with_second_currency.php:38
Magento
$cache
$cache
Definition:
application_cache.php:8
Magento\PageCache\Model\Config\BUILT_IN
const BUILT_IN
Definition:
Config.php:26