class Properties extends Collection implements CollectionInterface

Properties collection

Properties

protected array $data Collection items data from Collection

Methods

__construct(array $data = [])

Constructor

static Collection
create(array $data)

Create colleciton

static Collection
createFromFile(string $fileName, string|null $root = null, array|null $vars = null)

Create colection form json file

ArrayIterator
getIterator()

Return iterator

bool
has(string $key)

Return true if key exists in collection

bool
offsetExists(string $key)

Return true if key exists in collection

union(array $data)

Union arrays

replace(array $replacement)

Replace array

mixed
offsetGet(string $key)

Get item

void
offsetSet(string $key, mixed $value)

Set item

void
offsetUnset(string $key)

Remove item

remove(string $key)

Remove item

void
removeEmptyItems()

Remove empy items

integer
count()

Return collection items count.

void
setBooleanValue(string $path, integer|string $value)

Set bool value

void
setValue(string $path, mixed $value)

Set item value by path

void
merge(string $key, array $data, bool $recursive = false)

Merge collection items

void
mergeItems(array $data, bool $recursive = false)

Merge all collection items

Collection
set(string $key, mixed $value)

Set item value in collection

void
add(string $key, mixed $value)

Add item to collection

bool
push(string $key, mixed $value, string|null $subKey = null)

Push value to collection

bool
prepend(string $key, mixed $value, string|null $subKey = null)

Add value to begining of collection array

withData(array $data)

Set collection data

array
slice(array|string $keys)

Slice collecion by keys

array
toArray()

Return collection array

bool
isEmpty(string $key)

Return true if key exists and value not empty in collection

getCollection(string $key)

Get collection item

mixed
get(string $key, mixed $default = null)

Get value from collection

bool
getBool(string $key, bool|null $default = null)

Get boolean value

string|null
getString(string $key, string|null $default = null)

Get text value

int|null
getInt(string $key, int|null $default = null)

Get int value

float|null
getFloat(string $key, float|null $default = null)

Get float value

array
getArray(string $key, mixed $default = null)

Return array values

void
clear()

Clear collection data

Collection
copy()

Clone object

mixed
__get(string $key)

Get value

__set(string $key, mixed $value)

Set value

mixed
getByPath(string $path, mixed $default = null)

Get value by path

bool
addField(string $path, mixed $value)

Add value

array
getItems()

Get collection items

property(string $name, array|object|string|Callable $descriptor)

Set property

PropertyInterface|null
getProperty(string $name)

Get property

array
getProperties()

Get properties, return Property objects array

mixed
getValue(string $key, string|null $group = null)

Get property value

string
getValueAsText(string $key, string|null $group = null)

Get property value

int|null
getType(string $key, string|null $group = null)

Get property type

array
getGroups()

Get groups

array
gePropertiesList(bool $readonly = false, bool $hidden = false, string|null $group = null)

Get properties list

array
getValues()

Get values

void
clearValues()

Clear property values

void
setPropertyValues(array $data)

Set value of every property from data array

bool
setPropertyValue(string $key, mixed $value)

Set property value

Details

at line 27
__construct(array $data = [])

Constructor

Parameters

array $data

in Collection at line 45
static Collection create(array $data)

Create colleciton

Parameters

array $data

Return Value

Collection

in Collection at line 58
static Collection createFromFile(string $fileName, string|null $root = null, array|null $vars = null)

Create colection form json file

Parameters

string $fileName
string|null $root
array|null $vars

Return Value

Collection

in Collection at line 73
ArrayIterator getIterator()

Return iterator

Return Value

ArrayIterator

in Collection at line 84
bool has(string $key)

Return true if key exists in collection

Parameters

string $key

Return Value

bool

in Collection at line 95
bool offsetExists(string $key)

Return true if key exists in collection

Parameters

string $key

Return Value

bool

in Collection at line 106
Collection union(array $data)

Union arrays

Parameters

array $data

Return Value

Collection

in Collection at line 119
Collection replace(array $replacement)

Replace array

Parameters

array $replacement

Return Value

Collection

in Collection at line 132
mixed offsetGet(string $key)

Get item

Parameters

string $key

Return Value

mixed

in Collection at line 144
void offsetSet(string $key, mixed $value)

Set item

Parameters

string $key
mixed $value

Return Value

void

in Collection at line 155
void offsetUnset(string $key)

Remove item

Parameters

string $key

Return Value

void

in Collection at line 166
Collection remove(string $key)

Remove item

Parameters

string $key

Return Value

Collection

in Collection at line 178
void removeEmptyItems()

Remove empy items

Return Value

void

in Collection at line 190
integer count()

Return collection items count.

Return Value

integer

in Collection at line 202
void setBooleanValue(string $path, integer|string $value)

Set bool value

Parameters

string $path
integer|string $value

Return Value

void

in Collection at line 221
void setValue(string $path, mixed $value)

Set item value by path

Parameters

string $path
mixed $value

Return Value

void

in Collection at line 234
void merge(string $key, array $data, bool $recursive = false)

Merge collection items

Parameters

string $key
array $data
bool $recursive

Return Value

void

in Collection at line 249
void mergeItems(array $data, bool $recursive = false)

Merge all collection items

Parameters

array $data
bool $recursive

Return Value

void

in Collection at line 261
Collection set(string $key, mixed $value)

Set item value in collection

Parameters

string $key Key Name
mixed $value Value

Return Value

Collection

in Collection at line 275
void add(string $key, mixed $value)

Add item to collection

Parameters

string $key key name
mixed $value

Return Value

void

in Collection at line 292
bool push(string $key, mixed $value, string|null $subKey = null)

Push value to collection

Parameters

string $key
mixed $value
string|null $subKey

Return Value

bool

in Collection at line 319
bool prepend(string $key, mixed $value, string|null $subKey = null)

Add value to begining of collection array

Parameters

string $key
mixed $value
string|null $subKey

Return Value

bool

in Collection at line 343
Collection withData(array $data)

Set collection data

Parameters

array $data

Return Value

Collection

in Collection at line 356
array slice(array|string $keys)

Slice collecion by keys

Parameters

array|string $keys

Return Value

array

in Collection at line 366
array toArray()

Return collection array

Return Value

array

in Collection at line 377
bool isEmpty(string $key)

Return true if key exists and value not empty in collection

Parameters

string $key

Return Value

bool

in Collection at line 388
Collection getCollection(string $key)

Get collection item

Parameters

string $key

Return Value

Collection

in Collection at line 400
mixed get(string $key, mixed $default = null)

Get value from collection

Parameters

string $key Name
mixed $default If key not exists return default value

Return Value

mixed

in Collection at line 412
bool getBool(string $key, bool|null $default = null)

Get boolean value

Parameters

string $key
bool|null $default

Return Value

bool

in Collection at line 424
string|null getString(string $key, string|null $default = null)

Get text value

Parameters

string $key
string|null $default

Return Value

string|null

in Collection at line 438
int|null getInt(string $key, int|null $default = null)

Get int value

Parameters

string $key
int|null $default

Return Value

int|null

in Collection at line 452
float|null getFloat(string $key, float|null $default = null)

Get float value

Parameters

string $key
float|null $default

Return Value

float|null

in Collection at line 466
array getArray(string $key, mixed $default = null)

Return array values

Parameters

string $key
mixed $default

Return Value

array

in Collection at line 478
void clear()

Clear collection data

Return Value

void

in Collection at line 488
Collection copy()

Clone object

Return Value

Collection

in Collection at line 499
mixed __get(string $key)

Get value

Parameters

string $key

Return Value

mixed

in Collection at line 510
__set(string $key, mixed $value)

Set value

Parameters

string $key
mixed $value

in Collection at line 522
mixed getByPath(string $path, mixed $default = null)

Get value by path

Parameters

string $path
mixed $default

Return Value

mixed

in Collection at line 536
bool addField(string $path, mixed $value)

Add value

Parameters

string $path
mixed $value

Return Value

bool

in Collection at line 555
array getItems()

Get collection items

Return Value

array

at line 39
Properties property(string $name, array|object|string|Callable $descriptor)

Set property

Parameters

string $name
array|object|string|Callable $descriptor

Return Value

Properties

at line 80
PropertyInterface|null getProperty(string $name)

Get property

Parameters

string $name

Return Value

PropertyInterface|null

at line 101
array getProperties()

Get properties, return Property objects array

Return Value

array

at line 113
mixed getValue(string $key, string|null $group = null)

Get property value

Parameters

string $key
string|null $group

Return Value

mixed

at line 133
string getValueAsText(string $key, string|null $group = null)

Get property value

Parameters

string $key
string|null $group

Return Value

string

at line 154
int|null getType(string $key, string|null $group = null)

Get property type

Parameters

string $key
string|null $group

Return Value

int|null

at line 169
array getGroups()

Get groups

Return Value

array

at line 191
array gePropertiesList(bool $readonly = false, bool $hidden = false, string|null $group = null)

Get properties list

Parameters

bool $readonly
bool $hidden
string|null $group

Return Value

array

at line 249
array getValues()

Get values

Return Value

array

at line 284
void clearValues()

Clear property values

Return Value

void

at line 305
void setPropertyValues(array $data)

Set value of every property from data array

Parameters

array $data

Return Value

void

at line 331
bool setPropertyValue(string $key, mixed $value)

Set property value

Parameters

string $key
mixed $value

Return Value

bool