Class NArrayTools (namespace Nette)
Array tools library.
Public Method Summary | |
---|---|
NArrayTools |
__construct
()
Static class - cannot be instantiated.
|
static mixed |
get
($arr, mixed $key, [mixed $default =
NULL ])
Returns array item or $default if item is not set.
|
static void |
insertAfter
(&$arr, mixed $key, $inserted)
Inserts new array after item specified by key.
|
static void |
insertBefore
(&$arr, mixed $key, $inserted)
Inserts new array before item specified by key.
|
static array |
mergeTree
(array $arr1, array $arr2)
Recursively appends elements of remaining keys from the second array to the first.
|
static int |
searchKey
(array $arr, mixed $key)
Searches the array for a given key and returns the offset if successful.
|
Method Details | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 35 __constructpublic NArrayTools __construct () Static class - cannot be instantiated.
|
||||||||||||||||||
line 50 getpublic static mixed get ($arr, mixed $key, [mixed $default = Returns array item or $default if item is not set. Example: $val = NArrayTools::get($arr, 'i', 123);
|
||||||||||||||||||
line 124 insertAfterpublic static void insertAfter (&$arr, mixed $key, $inserted) Inserts new array after item specified by key.
|
||||||||||||||||||
line 109 insertBeforepublic static void insertBefore (&$arr, mixed $key, $inserted) Inserts new array before item specified by key.
|
||||||||||||||||||
line 75 mergeTreepublic static array mergeTree (array $arr1, array $arr2) Recursively appends elements of remaining keys from the second array to the first.
|
||||||||||||||||||
line 94 searchKeypublic static int searchKey (array $arr, mixed $key) Searches the array for a given key and returns the offset if successful.
|