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-widget
Helper
Conditions.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Widget\Helper
;
7
8
use
Magento\Framework\Data\Wysiwyg\Normalizer
;
9
use
Magento\Framework\App\ObjectManager
;
10
use
Magento\Framework\Serialize\Serializer\Json
;
11
15
class
Conditions
16
{
20
private
$serializer;
21
25
private
$normalizer;
26
31
public
function
__construct
(
32
Json
$serializer =
null
,
33
Normalizer
$normalizer =
null
34
) {
35
$this->serializer = $serializer ?:
ObjectManager::getInstance
()->get(Json::class);
36
$this->normalizer = $normalizer ?:
ObjectManager::getInstance
()->get(Normalizer::class);
37
}
38
45
public
function
encode
(array
$value
)
46
{
47
return
$this->normalizer->replaceReservedCharacters($this->serializer->serialize(
$value
));
48
}
49
56
public
function
decode
(
$value
)
57
{
58
return
$this->serializer->unserialize(
59
$this->normalizer->restoreReservedCharacters(
$value
)
60
);
61
}
62
}
Magento\Framework\Serialize\Serializer\Json
Definition:
Json.php:16
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
Magento\Widget\Helper\Conditions\decode
decode($value)
Definition:
Conditions.php:56
Magento\Widget\Helper
Definition:
Conditions.php:6
Magento\Widget\Helper\Conditions\encode
encode(array $value)
Definition:
Conditions.php:45
Magento\Framework\App\ObjectManager
Definition:
ConfigCache.php:8
$value
$value
Definition:
gender.phtml:16
Magento\Widget\Helper\Conditions
Definition:
Conditions.php:15
Magento\Framework\Data\Wysiwyg\Normalizer
Definition:
Normalizer.php:11
Magento\Widget\Helper\Conditions\__construct
__construct(Json $serializer=null, Normalizer $normalizer=null)
Definition:
Conditions.php:31