CollectionInterface
in
Collection interface
Table of Contents
Methods
- clear() : void
- Delete all collection items
- copy() : Collection
- Copy collection
- get() : mixed
- Get value from collection
- getByPath() : mixed
- Get value by path
- isEmpty() : bool
- Return true if collection item is empty
- set() : Collection
- Set item value in collection
- toArray() : array<string|int, mixed>
- Convert collection to array
Methods
clear()
Delete all collection items
public
clear() : void
copy()
Copy collection
public
copy() : Collection
Return values
Collectionget()
Get value from collection
public
get(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
-
Name
- $default : mixed = null
-
If key not exists return default value
getByPath()
Get value by path
public
getByPath(string $path[, mixed $default = null ]) : mixed
Parameters
- $path : string
- $default : mixed = null
isEmpty()
Return true if collection item is empty
public
isEmpty(string $key) : bool
Parameters
- $key : string
Return values
boolset()
Set item value in collection
public
set(string $key, mixed $value) : Collection
Parameters
- $key : string
-
Key Name
- $value : mixed
-
Value
Return values
CollectiontoArray()
Convert collection to array
public
toArray() : array<string|int, mixed>