Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
EnabledConnection.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  public function validate($configData)
19  {
20  $errors = [];
21  foreach ($configData as $name => $publisherData) {
22  if (!isset($publisherData['connections'])) {
23  continue;
24  }
25  $enabledConnections = 0;
26  foreach ($publisherData['connections'] as $connectionConfig) {
27  if ($connectionConfig['disabled'] == false) {
28  $enabledConnections++;
29  }
30  }
31 
32  if ($enabledConnections > 1) {
33  $errors[] = sprintf('More than 1 enabled connections configured for publisher %s.', $name);
34  }
35  }
36 
37  if (!empty($errors)) {
38  throw new \LogicException(implode(' ', $errors));
39  }
40  }
41 }
$errors
Definition: overview.phtml:9
if(!isset($_GET['name'])) $name
Definition: log.php:14