См. определение в файле collection.php строка 6
◆ clone()
static clone |
( |
array | $originalArray | ) |
|
|
static |
Clone array recursively. Keys are preserved
- Аргументы
-
array | $originalArray | - array to clone |
- Возвращает
- array
См. определение в файле collection.php строка 191
◆ firstNotEmpty()
Takes all arguments by pairs.. Odd arguments are arrays. Even arguments are keys to lookup in these arrays. Keys may be arrays. In this case function will try to dig deeper. Returns first not empty element of a[k] pair.
- Аргументы
-
array | $a | array to analyze |
string | int | $k | key to lookup |
mixed | $a,... | unlimited array/key pairs to go through |
- Возвращает
- mixed|string
См. определение в файле collection.php строка 108
◆ getByNestedKey()
static getByNestedKey |
( |
array | $array, |
|
|
array | $key ) |
|
static |
Returns $array[p1][p2][p3] with $key = [p1, p2, p3]
- Аргументы
-
- Возвращает
- mixed
См. определение в файле collection.php строка 218
◆ isAssociative()
static isAssociative |
( |
array | $array | ) |
|
|
static |
Check array is associative.
- Аргументы
-
- Возвращает
- bool
См. определение в файле collection.php строка 177
◆ normalizeArrayValuesByInt()
static normalizeArrayValuesByInt |
( |
& | $map, |
|
|
| $sorted = true ) |
|
static |
Convert array values to int, return unique values > 0. Optionally sorted array.
- Аргументы
-
array | &$map | Array for normalize. |
bool | $sorted | If sorted true, result array will be sorted. |
- Возвращает
- void
См. определение в файле collection.php строка 150
◆ setByNestedKey()
static setByNestedKey |
( |
array & | $array, |
|
|
array | $key, |
|
|
| $value ) |
|
static |
Sets value $array[p1][p2][p3] = $value with $key = [p1, p2, p3]
- Аргументы
-
array | $array | |
array | $key | |
| $value | |
- Возвращает
- void
- Исключения
-
См. определение в файле collection.php строка 253
◆ sortByColumn()
static sortByColumn |
( |
array & | $array, |
|
|
| $columns, |
|
|
| $callbacks = '', |
|
|
| $defaultValueIfNotSetValue = null, |
|
|
| $preserveKeys = false ) |
|
static |
Sorting array by column. You can use short mode: Collection::sortByColumn($arr, 'value'); This is equal Collection::sortByColumn($arr, array('value' => SORT_ASC))
Pay attention: if two members compare as equal, their relative order in the sorted array is undefined. The sorting is not stable.
More example: Collection::sortByColumn($arr, array('value' => array(SORT_NUMERIC, SORT_ASC), 'attr' => SORT_DESC), array('attr' => 'strlen'), 'www');
- Аргументы
-
array | $array | |
string | array | $columns | |
string | array | $callbacks | |
null | $defaultValueIfNotSetValue | If value not set - use $defaultValueIfNotSetValue (any cols) |
bool | $preserveKeys | If false numeric keys will be re-indexed. If true - preserve. |
- Исключения
-
Bitrix\Main\ArgumentOutOfRangeException
См. определение в файле collection.php строка 24
◆ unsetByNestedKey()
static unsetByNestedKey |
( |
array & | $array, |
|
|
array | $key ) |
|
static |
Unsets last key in array $array[p1][p2][p3] with $key = [p1, p2, p3]
- Аргументы
-
- Возвращает
- void
- Исключения
-
См. определение в файле collection.php строка 284