Arikaim CMS

CollectionInterface

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

get()

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
bool

set()

Set item value in collection

public set(string $key, mixed $value) : Collection
Parameters
$key : string

Key Name

$value : mixed

Value

Return values
Collection

toArray()

Convert collection to array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results