Arikaim CMS

Properties extends Collection
in package
implements CollectionInterface

Properties collection

Table of Contents

Interfaces

CollectionInterface
Collection interface

Properties

$data  : array<string|int, mixed>
Collection items data

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Get value
__set()  : mixed
Set value
add()  : void
Add item to collection
addField()  : bool
Add value
clear()  : void
Clear collection data
clearValues()  : void
Clear property values
copy()  : self
Clone object
count()  : int
Return collection items count.
create()  : Collection
Create colleciton
createFromFile()  : Collection
Create colection form json file
get()  : mixed
Get value from collection
getArray()  : array<string|int, mixed>
Return array values
getBool()  : bool
Get boolean value
getByPath()  : mixed
Get value by path
getCollection()  : Collection
Get collection item
getFloat()  : float|null
Get float value
getGroups()  : array<string|int, mixed>
Get groups
getInt()  : int|null
Get int value
getItems()  : array<string|int, mixed>
Get collection items
getIterator()  : ArrayIterator
Return iterator
getProperties()  : array<string|int, mixed>
Get properties, return Property objects array
getPropertiesList()  : array<string|int, mixed>
Get properties list
getProperty()  : PropertyInterface|null
Get property
getString()  : string
Get text value
getType()  : int|null
Get property type
getValue()  : mixed
Get property value
getValueAsText()  : string
Get property value
getValues()  : array<string|int, mixed>
Get values
has()  : bool
Return true if key exists in collection
isEmpty()  : bool
Return true if key exists and value not empty in collection
merge()  : void
Merge collection items
mergeItems()  : void
Merge all collection items
offsetExists()  : bool
Return true if key exists in collection
offsetGet()  : mixed
Get item
offsetSet()  : void
Set item
offsetUnset()  : void
Remove item
prepend()  : bool
Add value to begining of collection array
property()  : Properties
Create property
push()  : bool
Push value to collection
remove()  : Collection
Remove item
removeEmptyItems()  : void
Remove empy items
replace()  : Collection
Replace array
set()  : Collection
Set item value in collection
setArrayValue()  : array<string|int, mixed>
Set array value
setBooleanValue()  : void
Set bool value
setPropertyValue()  : bool
Set property value
setPropertyValues()  : void
Set value of every property from data array
setValue()  : void
Set item value by path
slice()  : array<string|int, mixed>
Slice collecion by keys
toArray()  : array<string|int, mixed>
Return collection array
union()  : Collection
Union arrays
withData()  : Collection
Set collection data

Properties

$data

Collection items data

protected array<string|int, mixed> $data = []

Methods

__construct()

Constructor

public __construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
$data : array<string|int, mixed> = []

__get()

Get value

public __get(string $key) : mixed
Parameters
$key : string

__set()

Set value

public __set(string $key, mixed $value) : mixed
Parameters
$key : string
$value : mixed

add()

Add item to collection

public add(string $key, mixed $value) : void
Parameters
$key : string

key name

$value : mixed

addField()

Add value

public addField(string $path, mixed $value) : bool
Parameters
$path : string
$value : mixed
Return values
bool

clear()

Clear collection data

public clear() : void

clearValues()

Clear property values

public clearValues() : void

copy()

Clone object

public copy() : self
Return values
self

count()

Return collection items count.

public count() : int
Return values
int

create()

Create colleciton

public static create(array<string|int, mixed> $data) : Collection
Parameters
$data : array<string|int, mixed>
Return values
Collection

createFromFile()

Create colection form json file

public static createFromFile(string $fileName[, string|null $root = null ][, array<string|int, mixed>|null $vars = null ]) : Collection
Parameters
$fileName : string
$root : string|null = null
$vars : array<string|int, mixed>|null = null
Return values
Collection

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

getArray()

Return array values

public getArray(string $key[, mixed $default = null ]) : array<string|int, mixed>
Parameters
$key : string
$default : mixed = null
Return values
array<string|int, mixed>

getBool()

Get boolean value

public getBool(string $key[, bool|null $default = null ]) : bool
Parameters
$key : string
$default : bool|null = null
Return values
bool

getByPath()

Get value by path

public getByPath(string $path[, mixed $default = null ]) : mixed
Parameters
$path : string
$default : mixed = null

getFloat()

Get float value

public getFloat(string $key[, float|null $default = null ]) : float|null
Parameters
$key : string
$default : float|null = null
Return values
float|null

getGroups()

Get groups

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

getInt()

Get int value

public getInt(string $key[, int|null $default = null ]) : int|null
Parameters
$key : string
$default : int|null = null
Return values
int|null

getItems()

Get collection items

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

getIterator()

Return iterator

public getIterator() : ArrayIterator
Return values
ArrayIterator

getProperties()

Get properties, return Property objects array

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

getPropertiesList()

Get properties list

public getPropertiesList([bool $readonly = false ][, bool $hidden = false ][, string|null $group = null ]) : array<string|int, mixed>
Parameters
$readonly : bool = false
$hidden : bool = false
$group : string|null = null
Return values
array<string|int, mixed>

getString()

Get text value

public getString(string $key[, string|null $default = null ]) : string
Parameters
$key : string
$default : string|null = null
Return values
string

getType()

Get property type

public getType(string $key[, string|null $group = null ]) : int|null
Parameters
$key : string
$group : string|null = null
Return values
int|null

getValue()

Get property value

public getValue(string $key[, string|null $group = null ]) : mixed
Parameters
$key : string
$group : string|null = null

getValueAsText()

Get property value

public getValueAsText(string $key[, string|null $group = null ]) : string
Parameters
$key : string
$group : string|null = null
Return values
string

getValues()

Get values

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

has()

Return true if key exists in collection

public has(string $key) : bool
Parameters
$key : string
Return values
bool

isEmpty()

Return true if key exists and value not empty in collection

public isEmpty(string $key) : bool
Parameters
$key : string

Name

Return values
bool

merge()

Merge collection items

public merge(string $key, array<string|int, mixed> $data[, bool $recursive = false ]) : void
Parameters
$key : string
$data : array<string|int, mixed>
$recursive : bool = false

mergeItems()

Merge all collection items

public mergeItems(array<string|int, mixed> $data[, bool $recursive = false ]) : void
Parameters
$data : array<string|int, mixed>
$recursive : bool = false

offsetExists()

Return true if key exists in collection

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

Get item

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

Set item

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

Remove item

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

prepend()

Add value to begining of collection array

public prepend(string $key, mixed $value[, string|null $subKey = null ]) : bool
Parameters
$key : string
$value : mixed
$subKey : string|null = null
Return values
bool

property()

Create property

public property(string $name, array<string|int, mixed>|object|string|callable $descriptor) : Properties
Parameters
$name : string
$descriptor : array<string|int, mixed>|object|string|callable
Return values
Properties

push()

Push value to collection

public push(string $key, mixed $value[, string|null $subKey = null ]) : bool
Parameters
$key : string
$value : mixed
$subKey : string|null = null
Return values
bool

removeEmptyItems()

Remove empy items

public removeEmptyItems() : void

replace()

Replace array

public replace(array<string|int, mixed> $replacement) : Collection
Parameters
$replacement : array<string|int, mixed>
Return values
Collection

set()

Set item value in collection

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

Key Name

$value : mixed

Value

Return values
Collection

setArrayValue()

Set array value

public static setArrayValue(array<string|int, mixed> $array, string $path, mixed $value[, string $separator = '/' ]) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
$path : string
$value : mixed
$separator : string = '/'
Return values
array<string|int, mixed>

setBooleanValue()

Set bool value

public setBooleanValue(string $path, int|string $value) : void
Parameters
$path : string
$value : int|string

setPropertyValue()

Set property value

public setPropertyValue(string $key, mixed $value) : bool
Parameters
$key : string
$value : mixed
Return values
bool

setPropertyValues()

Set value of every property from data array

public setPropertyValues(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

setValue()

Set item value by path

public setValue(string $path, mixed $value) : void
Parameters
$path : string
$value : mixed

slice()

Slice collecion by keys

public slice(array<string|int, mixed>|string $keys) : array<string|int, mixed>
Parameters
$keys : array<string|int, mixed>|string
Return values
array<string|int, mixed>

toArray()

Return collection array

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

union()

Union arrays

public union(array<string|int, mixed> $data) : Collection
Parameters
$data : array<string|int, mixed>
Return values
Collection

withData()

Set collection data

public withData(array<string|int, mixed> $data) : Collection
Parameters
$data : array<string|int, mixed>
Return values
Collection

        
On this page

Search results