PHP Class N98\Util\ArrayFunctions

Datei anzeigen Open project: netz98/n98-magerun Class Usage Examples

Public Methods

Method Description
columnOrder ( array $columns, array $array ) : array order array entries (named and numbered) of array by the columns given as string keys.
columnOrderArrayTable ( array $columns, array $table ) : array
matrixFilterByValue ( array $matrix, string $key, mixed $value ) : array
matrixFilterStartswith ( array $matrix, string $key, string $value ) : array
mergeArrays ( array $a, array $b ) : array Merge two arrays together.

Private Methods

Method Description
matrixCallbackFilter ( array $matrix, callable $callback ) : array

Method Details

columnOrder() public static method

non-existent columns default to numbered entries or if no numbered entries exists any longer, to null. entries in array that could not consume any column are put after the columns.
public static columnOrder ( array $columns, array $array ) : array
$columns array
$array array
return array

columnOrderArrayTable() public static method

public static columnOrderArrayTable ( array $columns, array $table ) : array
$columns array
$table array
return array table with ordered columns

matrixFilterByValue() public static method

public static matrixFilterByValue ( array $matrix, string $key, mixed $value ) : array
$matrix array
$key string key to filter
$value mixed to compare against (strict comparison)
return array

matrixFilterStartswith() public static method

public static matrixFilterStartswith ( array $matrix, string $key, string $value ) : array
$matrix array
$key string to filter
$value string to compare against
return array

mergeArrays() public static method

If an integer key exists in both arrays, the value from the second array will be appended the the first array. If both values are arrays, they are merged together, else the value of the second array overwrites the one of the first array.
See also: http://packages.zendframework.com/docs/latest/manual/en/index.html#zend-stdlib
public static mergeArrays ( array $a, array $b ) : array
$a array
$b array
return array