PHP Class N98\Util\ArrayFunctions

Afficher le fichier Open project: netz98/n98-magerun Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
matrixCallbackFilter ( array $matrix, callable $callback ) : array

Method Details

columnOrder() public static méthode

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
Résultat array

columnOrderArrayTable() public static méthode

public static columnOrderArrayTable ( array $columns, array $table ) : array
$columns array
$table array
Résultat array table with ordered columns

matrixFilterByValue() public static méthode

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

matrixFilterStartswith() public static méthode

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

mergeArrays() public static méthode

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
Résultat array