PHP Class FluidTYPO3\Flux\Utility\RecursiveArrayUtility

Exibir arquivo Open project: fluidtypo3/flux Class Usage Examples

Public Methods

Method Description
convertPathToArray ( string $path, mixed $value = NULL ) : array This method convert a string like "Some.long.tree" into an array ["Some"=>["long"=>["tree"=> $value]]]
diff ( array $array1, array $array2 ) : array
merge ( array $array1, array $array2 ) : array
mergeRecursiveOverrule ( array $firstArray, array $secondArray, boolean $notAddKeys = FALSE, boolean $includeEmptyValues = TRUE, boolean $enableUnsetFeature = TRUE ) : array

Method Details

convertPathToArray() public static method

This method convert a string like "Some.long.tree" into an array ["Some"=>["long"=>["tree"=> $value]]]
public static convertPathToArray ( string $path, mixed $value = NULL ) : array
$path string
$value mixed
return array

diff() public static method

public static diff ( array $array1, array $array2 ) : array
$array1 array
$array2 array
return array

merge() public static method

public static merge ( array $array1, array $array2 ) : array
$array1 array
$array2 array
return array

mergeRecursiveOverrule() public static method

public static mergeRecursiveOverrule ( array $firstArray, array $secondArray, boolean $notAddKeys = FALSE, boolean $includeEmptyValues = TRUE, boolean $enableUnsetFeature = TRUE ) : array
$firstArray array First array
$secondArray array Second array, overruling the first array
$notAddKeys boolean If set, keys that are NOT found in $firstArray will not be set. Thus only existing value can/will be overruled from second array.
$includeEmptyValues boolean If set, values from $secondArray will overrule if they are empty or zero. Default: TRUE
$enableUnsetFeature boolean If set, special values "__UNSET" can be used in the second array in order to unset array keys in the resulting array.
return array Resulting array where $secondArray values has overruled $firstArray values