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-store
Model
Config
Validator.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Store\Model\Config
;
7
8
use
Magento\Framework\App\DeploymentConfig\ValidatorInterface
;
9
use
Magento\Store\Model\ScopeInterface
;
10
14
class
Validator
implements
ValidatorInterface
15
{
21
public
function
validate
(array
$data
)
22
{
23
$errorMessage = [
'Scopes data should have at least one not admin website, group and store.'
];
24
//list of scope names and their identifier for admin scopes in $data.
25
$entities = [
26
ScopeInterface::SCOPE_GROUPS
=> 0,
27
ScopeInterface::SCOPE_STORES
=>
'admin'
,
28
ScopeInterface::SCOPE_WEBSITES
=>
'admin'
29
];
30
foreach
($entities as $scopeName => $key) {
31
if
(empty(
$data
[$scopeName])
32
|| (count(
$data
[$scopeName]) == 1 && isset(
$data
[$scopeName][$key]))) {
33
return
$errorMessage;
34
}
35
}
36
return
[];
37
}
38
}
Magento\Store\Model\ScopeInterface\SCOPE_WEBSITES
const SCOPE_WEBSITES
Definition:
ScopeInterface.php:19
Magento\Store\Model\ScopeInterface\SCOPE_GROUPS
const SCOPE_GROUPS
Definition:
ScopeInterface.php:18
Magento\Framework\App\DeploymentConfig\ValidatorInterface
Definition:
ValidatorInterface.php:11
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Store\Model\ScopeInterface\SCOPE_STORES
const SCOPE_STORES
Definition:
ScopeInterface.php:17
Magento\Store\Model\ScopeInterface
Definition:
ScopeInterface.php:12
Magento\Store\Model\Config\Validator\validate
validate(array $data)
Definition:
Validator.php:21
Magento\Store\Model\Config
Definition:
Converter.php:8
Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing\Validator
Definition:
TierPrice.php:6