class Arrays

Class Arrays

Helper for arrays

Methods

static array
filter(array $rows, $filterScheme)

Filter array by filter scheme

static array
group($array, $column)

Group array by known column

static array
column(array $input, mixed $columnKey = null, mixed $indexKey = null)

This file is part of the array_column library

static array
diff($old, $new)

Ice array diff

static array
defaults(array $defaults, array $data = null)

Apply default values to array

static bool
validate(array $data, array $validators = array())

Validate array

static array
convert(array $data, array $converters = array())

Convert array data

static 
toJsObjectString(array $array)

No description

static string
toJsArrayString(array $array)

Convert array to string

Details

at line 47
static array filter(array $rows, $filterScheme)

Filter array by filter scheme

$filterScheme = [ ['name', 'Petya', '='], ['age', 18, '>'], ['surname', 'Iv%', 'like'] ];

Parameters

array $rows
$filterScheme

Return Value

array

at line 109
static array group($array, $column)

Group array by known column

Parameters

$array
$column

Return Value

array

at line 149
static array column(array $input, mixed $columnKey = null, mixed $indexKey = null)

This file is part of the array_column library

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Parameters

array $input A multi-dimensional array (record set) from which to pull a column of values.
mixed $columnKey The column(s) of values to return. This value may be null, 0, array or any string may be the string key name for an associative array.
mixed $indexKey (Optional.) The column to use as the index/keys for the returned array. This value may be null, '', or any string of the column, or it may be the string key name.

Return Value

array

at line 231
static array diff($old, $new)

Ice array diff

Return array of added, deleted and other rows

Parameters

$old
$new

Return Value

array

at line 255
static array defaults(array $defaults, array $data = null)

Apply default values to array

Parameters

array $defaults
array $data

Return Value

array

at line 280
static bool validate(array $data, array $validators = array())

Validate array

Parameters

array $data
array $validators

Return Value

bool

at line 297
static array convert(array $data, array $converters = array())

Convert array data

Parameters

array $data
array $converters

Return Value

array

at line 310
static toJsObjectString(array $array)

Parameters

array $array

at line 333
static string toJsArrayString(array $array)

Convert array to string

Parameters

array $array

Return Value

string