Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Identity.php
Go to the documentation of this file.
1 <?php
7 
13 {
19  protected $_options = null;
20 
26  protected $_configStructure;
27 
31  public function __construct(\Magento\Config\Model\Config\Structure $configStructure)
32  {
33  $this->_configStructure = $configStructure;
34  }
35 
41  public function toOptionArray()
42  {
43  if ($this->_options === null) {
44  $this->_options = [];
46  $section = $this->_configStructure->getElement('trans_email');
47 
49  foreach ($section->getChildren() as $group) {
50  $this->_options[] = [
51  'value' => preg_replace('#^ident_(.*)$#', '$1', $group->getId()),
52  'label' => $group->getLabel(),
53  ];
54  }
55  ksort($this->_options);
56  }
57  return $this->_options;
58  }
59 }
$group
Definition: sections.phtml:16
__construct(\Magento\Config\Model\Config\Structure $configStructure)
Definition: Identity.php:31