Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Converter.php
Go to the documentation of this file.
1 <?php
7 
8 class Converter
9 {
13  protected $groupsConfig;
14 
18  public function __construct(\Magento\Cron\Model\Groups\Config\Data $groupsConfig)
19  {
20  $this->groupsConfig = $groupsConfig;
21  }
22 
33  public function afterConvert(\Magento\Config\Model\Config\Structure\Converter $subject, array $result)
34  {
35  $groupIterator = 0;
36  if (!isset($result['config']['system']['sections']['system']['children']['cron']['children']['template'])) {
37  return $result;
38  }
39  foreach ($this->groupsConfig->get() as $group => $fields) {
40  $template = $result['config']['system']['sections']['system']['children']['cron']['children']['template'];
41  $template['id'] = $group;
42  $template['label'] .= $group;
43  $template['sortOrder'] += $groupIterator++;
44 
45  $fieldIterator = 0;
46  foreach ($fields as $fieldName => $value) {
47  $template['children'][$fieldName]['path'] = 'system/cron/' . $group;
48  $template['children'][$fieldName]['sortOrder'] += $fieldIterator++;
49  if (isset($value['tooltip'])) {
50  $template['children'][$fieldName]['tooltip'] = $value['tooltip'];
51  }
52  }
53  $result['config']['system']['sections']['system']['children']['cron']['children'][$group] = $template;
54  }
55  unset($result['config']['system']['sections']['system']['children']['cron']['children']['template']);
56  return $result;
57  }
58 }
afterConvert(\Magento\Config\Model\Config\Structure\Converter $subject, array $result)
Definition: Converter.php:33
$group
Definition: sections.phtml:16
$fields
Definition: details.phtml:14
__construct(\Magento\Cron\Model\Groups\Config\Data $groupsConfig)
Definition: Converter.php:18
$value
Definition: gender.phtml:16
$template
Definition: export.php:12