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-new-relic-reporting
Model
Observer
ReportSystemCacheFlush.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\NewRelicReporting\Model\Observer
;
7
8
use
Magento\Framework\Event\Observer
;
9
use
Magento\Framework\Event\ObserverInterface
;
10
use
Magento\NewRelicReporting\Model\Config
;
11
15
class
ReportSystemCacheFlush
implements
ObserverInterface
16
{
20
protected
$config
;
21
25
protected
$systemFactory
;
26
30
protected
$jsonEncoder
;
31
37
public
function
__construct
(
38
Config
$config
,
39
\
Magento
\NewRelicReporting\Model\SystemFactory
$systemFactory
,
40
\
Magento
\Framework\Json\EncoderInterface
$jsonEncoder
41
) {
42
$this->config =
$config
;
43
$this->systemFactory =
$systemFactory
;
44
$this->jsonEncoder =
$jsonEncoder
;
45
}
46
54
public
function
execute
(
Observer
$observer
)
55
{
56
if
($this->config->isNewRelicEnabled()) {
57
$jsonData = [
'status'
=>
'updated'
];
58
59
$modelData = [
60
'type'
=>
Config::FLUSH_CACHE
,
61
'action'
=> $this->jsonEncoder->encode($jsonData)
62
];
63
65
$systemModel = $this->systemFactory->create();
66
$systemModel->setData($modelData);
67
$systemModel->save();
68
}
69
}
70
}
Magento\NewRelicReporting\Model\Observer\ReportSystemCacheFlush\__construct
__construct(Config $config, \Magento\NewRelicReporting\Model\SystemFactory $systemFactory, \Magento\Framework\Json\EncoderInterface $jsonEncoder)
Definition:
ReportSystemCacheFlush.php:37
Magento\Framework\Event\ObserverInterface
Definition:
ObserverInterface.php:16
Magento\NewRelicReporting\Model\Observer\ReportSystemCacheFlush\$jsonEncoder
$jsonEncoder
Definition:
ReportSystemCacheFlush.php:30
Magento\NewRelicReporting\Model\Observer\ReportSystemCacheFlush
Definition:
ReportSystemCacheFlush.php:15
$observer
$observer
Definition:
second_website_with_second_currency.php:38
Magento\NewRelicReporting\Model\Observer\ReportSystemCacheFlush\$config
$config
Definition:
ReportSystemCacheFlush.php:20
Magento\NewRelicReporting\Model\Observer\ReportSystemCacheFlush\$systemFactory
$systemFactory
Definition:
ReportSystemCacheFlush.php:25
Magento\Framework\Event\Observer
Definition:
Collection.php:12
Magento
Magento\NewRelicReporting\Model\Config
Definition:
Config.php:11
Magento\NewRelicReporting\Model\Config\FLUSH_CACHE
const FLUSH_CACHE
Definition:
Config.php:25
Magento\NewRelicReporting\Model\Observer
Definition:
CheckConfig.php:6
Magento\Framework\Event\ObserverInterface\execute
execute(Observer $observer)
Magento\Framework\Event\Observer
Definition:
Observer.php:14