|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| exists ($path, array $data, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| get ($path, array $data, $defaultValue=null, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| set ($path, array $data, $value, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| replace ($path, array $data, $value, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| move ($path, $targetPath, array $data, $overwrite=false, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| merge ($path, array $data, array $value, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| populate ($path, array $data, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| remove ($path, array $data, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| findPaths ( $indexes, array $data, $startPath=null, $internalPath=null, $maxResults=null, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| findPath ( $indexes, array $data, $startPath=null, $internalPath=null, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
| slicePath ($path, $offset, $length=null, $delimiter=self::DEFAULT_PATH_DELIMITER) | |
Data Fields | |
| const | DEFAULT_PATH_DELIMITER = '/' |
Protected Member Functions | |
| find ($path, array &$data, $delimiter, $populate=false) | |
Protected Attributes | |
| $parentNode | |
| $nodeIndex | |
Provides methods for nested array manipulations
@api
Definition at line 14 of file ArrayManager.php.
| exists | ( | $path, | |
| array | $data, | ||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Check if node exists
| array | string | $path | |
| array | $data | |
| string | $delimiter |
Definition at line 42 of file ArrayManager.php.
|
protected |
Finds node in nested array and saves its index and parent node reference
| array | string | $path | |
| array | $data | |
| string | $delimiter | |
| bool | $populate |
Definition at line 194 of file ArrayManager.php.
| findPath | ( | $indexes, | |
| array | $data, | ||
$startPath = null, |
|||
$internalPath = null, |
|||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Get first matching path for elements with specified indexes
| array | mixed | $indexes | |
| array | $data | |
| string | array | null | $startPath | |
| string | array | null | $internalPath | |
| string | $delimiter |
Definition at line 300 of file ArrayManager.php.
| findPaths | ( | $indexes, | |
| array | $data, | ||
$startPath = null, |
|||
$internalPath = null, |
|||
$maxResults = null, |
|||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Get matching paths for elements with specified indexes
| array | mixed | $indexes | |
| array | $data | |
| string | array | null | $startPath | |
| string | array | null | $internalPath | |
| int | null | $maxResults | |
| string | $delimiter |
Definition at line 242 of file ArrayManager.php.
| get | ( | $path, | |
| array | $data, | ||
$defaultValue = null, |
|||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Retrieve node
| array | string | $path | |
| array | $data | |
| null | $defaultValue | |
| string | $delimiter |
Definition at line 57 of file ArrayManager.php.
| merge | ( | $path, | |
| array | $data, | ||
| array | $value, | ||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Merge value with node and return modified data
| array | string | $path | |
| array | $data | |
| array | $value | |
| string | $delimiter |
Definition at line 138 of file ArrayManager.php.
| move | ( | $path, | |
| $targetPath, | |||
| array | $data, | ||
$overwrite = false, |
|||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Move value from one location to another
| array | string | $path | |
| string | $targetPath | |
| array | $data | |
| bool | $overwrite | |
| string | $delimiter |
Definition at line 111 of file ArrayManager.php.
| populate | ( | $path, | |
| array | $data, | ||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Populate nested array if possible and needed
| array | string | $path | |
| array | $data | |
| string | $delimiter |
Definition at line 159 of file ArrayManager.php.
| remove | ( | $path, | |
| array | $data, | ||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Remove node and return modified data
| array | string | $path | |
| array | $data | |
| string | $delimiter |
Definition at line 175 of file ArrayManager.php.
| replace | ( | $path, | |
| array | $data, | ||
| $value, | |||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Set value into existing node and return modified data
| array | string | $path | |
| array | $data | |
| mixed | $value | |
| string | $delimiter |
Definition at line 91 of file ArrayManager.php.
| set | ( | $path, | |
| array | $data, | ||
| $value, | |||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Set value into node and return modified data
| array | string | $path | |
| array | $data | |
| mixed | $value | |
| string | $delimiter |
Definition at line 72 of file ArrayManager.php.
| slicePath | ( | $path, | |
| $offset, | |||
$length = null, |
|||
$delimiter = self::DEFAULT_PATH_DELIMITER |
|||
| ) |
Retrieve slice of specified path
| string | $path | |
| int | $offset | |
| int | null | $length | |
| string | $delimiter |
Definition at line 322 of file ArrayManager.php.
|
protected |
Definition at line 31 of file ArrayManager.php.
|
protected |
Definition at line 25 of file ArrayManager.php.
| const DEFAULT_PATH_DELIMITER = '/' |
Default node delimiter for path
Definition at line 19 of file ArrayManager.php.