Hazaar\Model
ChildArray
Strict model child array

The ChildArray class is designed to simple wrap the standard functions of a PHP array with the difference that it is instantiated with a data type that all the values it contains will be converted to.

Summary
MethodsPropertiesConstants
No constants
Properties
$allow_undefined
$allow_undefined
$type
$type
$values
$values
Methods
()
()
__call()
__call($func, $argv) : mixed
Magic method for calling array_* functions on the ChildArray class.
__construct()
__construct($type, $values = Array ( ) )
ChildArray Constructor

The constructor simply takes the data type to use to convert all the items stored in this array. This is any known data type (int, bool, etc) or even an object class. We use the same DataTypeConverter class as a strict model.

append()
append($value)
array_walk()
array_walk($callback, $userdata = null)
Apply a user supplied function to every member of an array

Applies the user-defined callback function to each element of the array array.

ChildArray::walk() is not affected by the internal array pointer of array. ChildArray::walk() will walk through the entire array regardless of pointer position.

For more information on this method see PHP's array_walk() function.

array_walk_recursive()
array_walk_recursive($callback, $userdata = null)
Apply a user supplied function to every member of an array

Applies the user-defined callback function to each element of the array array.

ChildArray::walk() is not affected by the internal array pointer of array. ChildArray::walk() will walk through the entire array regardless of pointer position.

For more information on this method see PHP's array_walk() function.

collate()
collate($key_field, $value_field = null)
count()
count()
current()
current()
Static
explode()
explode($type, $glue, $string, $limit = 'php_int_max') : ChildArray
ChildArray implementation of the explode function.

This operates mostly the same as the built-in PHP explode function except that it requires a type. The purpose of a ChildArray is to maintain data type of it's elements so a type is required.

find()
find($criteria = Array ( ) , $multiple = false)
get()
get($offset)
has()
has($key)
implode()
implode($glue) : string
ChildArray implementation of the implode function
jsonSerialize()
jsonSerialize()
key()
key()
matchItem()
matchItem($item, $criteria)
next()
next()
offsetExists()
offsetExists($offset)
offsetGet()
offsetGet($offset)
offsetSet()
offsetSet($offset, $value)
offsetUnset()
offsetUnset($offset)
remove()
remove($criteria = Array ( ) , $multiple = false)
rewind()
rewind()
toArray()
toArray($disable_callbacks = false, $depth = null, $show_hidden = true, $export_data_binder = false)
valid()
valid()