Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Validator.php
Go to the documentation of this file.
1 <?php
7 
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 = [
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 }