\ptejada\uFlexLinkedCollection

A Collection which references a existing array

Summary

Methods
Properties
Constants
__construct()
update()
toArray()
isEmpty()
filter()
get()
set()
count()
__get()
__set()
__isset()
__unset()
No public properties found
No constants found
No protected methods found
$_data
N/A
No private methods found
No private properties found
N/A

Properties

$_data

$_data : array

Type

array — The underlying original array

Methods

__construct()

__construct(array $info)

Takes the reference of an array

Parameters

array $info

update()

update(array $updates)

Update the collection with a given array of updates

Parameters

array $updates

toArray()

toArray() : array

Return the raw underling array of the collection

Returns

array

isEmpty()

isEmpty() : bool

Checks if the collection is empty

Returns

bool

filter()

filter()

Reduces the collection to only include allowed fields Every argument passed to this function is considered a field

get()

get(string $keyPath) : mixed|null|\ptejada\uFlex\Collection

Get a value of an entry in the collection Useful to get deep array elements without manually dealing with errors During the process

Parameters

string $keyPath
  • the period delimited location

Returns

mixed|null|\ptejada\uFlex\Collection

set()

set(string $keyPath, string $value)

Set a value to an index in the collection Used when the collection are nested

Parameters

string $keyPath
string $value

count()

count() : int

Return the number of items in the collection

Returns

int

__get()

__get(string $name) : mixed|\ptejada\uFlex\LinkedCollection

Magic getter for all first child properties

Parameters

string $name

Returns

mixed|\ptejada\uFlex\LinkedCollection

__set()

__set(string $name, string $value)

Magic setter for all first child properties

Parameters

string $name
string $value

__isset()

__isset(string $name) : bool

Check a property exists

Parameters

string $name

Returns

bool

__unset()

__unset(string $name)

Deletes a property from the collection

Parameters

string $name