Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
ksortMultibyte (array &$sort, $locale) | |
decorateArray ($array, $prefix='decorated_', $forceSetAll=false) | |
flatten (array $data, $path='', $separator='/') | |
recursiveDiff (array $originalArray, array $newArray) | |
decorateArray | ( | $array, | |
$prefix = 'decorated_' , |
|||
$forceSetAll = false |
|||
) |
Decorate a plain array of arrays or objects The array actually can be an object with Iterator interface
Keys with prefix_* will be set: *_is_first - if the element is first *_is_odd / *_is_even - for odd/even elements *_is_last - if the element is last
The respective key/attribute will be set to element, depending on object it is or array. \Magento\Framework\DataObject is supported.
$forceSetAll true will cause to set all possible values for all elements. When false (default), only non-empty values will be set.
array | $array | |
string | $prefix | |
bool | $forceSetAll |
Definition at line 64 of file ArrayUtils.php.
flatten | ( | array | $data, |
$path = '' , |
|||
$separator = '/' |
|||
) |
Expands multidimensional array into flat structure.
Example:
Expands to:
array | $data | The data to be flatten |
string | $path | The leading path |
string | $separator | The path parts separator |
Definition at line 156 of file ArrayUtils.php.
ksortMultibyte | ( | array & | $sort, |
$locale | |||
) |
Sorts array with multibyte string keys
array | $sort | |
string | $locale |
Definition at line 23 of file ArrayUtils.php.
recursiveDiff | ( | array | $originalArray, |
array | $newArray | ||
) |
Search for array differences recursively.
array | $originalArray | The array to compare from |
array | $newArray | The array to compare with |
Definition at line 187 of file ArrayUtils.php.