Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions | Protected Attributes
Dependencies Class Reference
Inheritance diagram for Dependencies:
AbstractMapper MapperInterface

Public Member Functions

 __construct (\Magento\Config\Model\Config\Structure\Mapper\Helper\RelativePathConverter $pathConverted)
 
 map (array $data)
 

Protected Member Functions

 _processConfig ($config)
 
 _processDepends ($config)
 
 _getDependPath ($field, $config)
 
- Protected Member Functions inherited from AbstractMapper
 _hasValue ($key, $target)
 

Protected Attributes

 $_pathConverter
 

Detailed Description

@api

Since
100.0.2

Definition at line 16 of file Dependencies.php.

Constructor & Destructor Documentation

◆ __construct()

Parameters
\Magento\Config\Model\Config\Structure\Mapper\Helper\RelativePathConverter$pathConverted

Definition at line 28 of file Dependencies.php.

30  {
31  $this->_pathConverter = $pathConverted;
32  }

Member Function Documentation

◆ _getDependPath()

_getDependPath (   $field,
  $config 
)
protected

Get depend path

Parameters
array$field
array$config
Returns
string[]
Exceptions

Definition at line 94 of file Dependencies.php.

95  {
96  $dependPath = $field['id'];
97  $elementPath = $config['path'] . '/' . $config['id'];
98 
99  return explode('/', $this->_pathConverter->convert($elementPath, $dependPath));
100  }
$config
Definition: fraud_order.php:17

◆ _processConfig()

_processConfig (   $config)
protected

Process configuration

Parameters
array$config
Returns
array

Definition at line 56 of file Dependencies.php.

57  {
59 
60  if ($this->_hasValue('children', $config)) {
61  foreach ($config['children'] as &$subConfig) {
62  $subConfig = $this->_processConfig($subConfig);
63  }
64  }
65  return $config;
66  }
$config
Definition: fraud_order.php:17

◆ _processDepends()

_processDepends (   $config)
protected

Process dependencies configuration

Parameters
array$config
Returns
array

Definition at line 74 of file Dependencies.php.

75  {
76  if ($this->_hasValue('depends/fields', $config)) {
77  foreach ($config['depends']['fields'] as &$field) {
78  $dependPath = $this->_getDependPath($field, $config);
79  $field['dependPath'] = $dependPath;
80  $field['id'] = implode('/', $dependPath);
81  }
82  }
83  return $config;
84  }
$config
Definition: fraud_order.php:17

◆ map()

map ( array  $data)

Apply map

Parameters
array$data
Returns
array

Implements MapperInterface.

Definition at line 40 of file Dependencies.php.

41  {
42  if ($this->_hasValue('config/system/sections', $data)) {
43  foreach ($data['config']['system']['sections'] as &$sectionConfig) {
44  $sectionConfig = $this->_processConfig($sectionConfig);
45  }
46  }
47  return $data;
48  }

Field Documentation

◆ $_pathConverter

$_pathConverter
protected

Definition at line 23 of file Dependencies.php.


The documentation for this class was generated from the following file: