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
Model
System
Config
Backend
Varnish.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\PageCache\Model\System\Config\Backend
;
7
13
class
Varnish
extends
\Magento\Framework\App\Config\Value
14
{
18
protected
$defaultValues
;
19
26
public
function
beforeSave
()
27
{
28
$data
= $this->
_getDefaultValues
();
29
$currentValue = $this->getValue();
30
if
(!$currentValue) {
31
$replaceValue = isset(
$data
[$this->getField()]) ?
$data
[$this->getField()] :
false
;
32
$this->setValue($replaceValue);
33
}
34
return
$this;
35
}
36
42
protected
function
_getDefaultValues
()
43
{
44
if
(!$this->defaultValues) {
45
$this->defaultValues = $this->_config->getValue(
'system/full_page_cache/default'
);
46
}
47
return
$this->defaultValues
;
48
}
49
55
protected
function
_afterLoad
()
56
{
57
$data
= $this->
_getDefaultValues
();
58
$currentValue = $this->getValue();
59
if
(!$currentValue) {
60
foreach
(
$data
as $field =>
$value
) {
61
if
(strstr($this->getPath(), $field)) {
62
$this->setValue(
$value
);
63
$this->
save
();
64
break
;
65
}
66
}
67
}
68
return
$this;
69
}
70
}
Magento\PageCache\Model\System\Config\Backend\Varnish\_afterLoad
_afterLoad()
Definition:
Varnish.php:55
Magento\PageCache\Model\System\Config\Backend\Varnish\beforeSave
beforeSave()
Definition:
Varnish.php:26
Magento\Framework\Model\AbstractModel\save
save()
Definition:
AbstractModel.php:646
Magento\PageCache\Model\System\Config\Backend\Varnish
Definition:
Varnish.php:13
Magento\PageCache\Model\System\Config\Backend
Definition:
TtlTest.php:6
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
$value
$value
Definition:
gender.phtml:16
Magento\PageCache\Model\System\Config\Backend\Varnish\_getDefaultValues
_getDefaultValues()
Definition:
Varnish.php:42
Magento\PageCache\Model\System\Config\Backend\Varnish\$defaultValues
$defaultValues
Definition:
Varnish.php:18