\Hazaar\Model
Strict
Abstract
Summary
Methods Properties Constants
ake
get
has
key
set
No constants
Properties
$__label
$__label
$allow_undefined
$allow_undefined
$convert_nulls
$convert_nulls
$current
$current
The current value for array access returned by each()
$disable_callbacks
$disable_callbacks
$fields
$fields
$ignore_undefined
$ignore_undefined
Static
$known_types
$known_types
$loaded
$loaded
$values
$values
Methods
__construct()
__construct()
__destruct()
__destruct()
__get()
__get($key)

Parameters

$key

No description

__set()
__set($key, $value)

Parameters

$key

No description

$value

No description

ake()
ake($key, $default = null, $non_empty = false)

Parameters

$key

No description

$default

No description

$non_empty

No description

append()
append($key, $item)
Append an element to an array item

Parameters

$keymixed

No description

$itemmixed

No description

convertType()
convertType($value, $type)

Parameters

$value

No description

$type

No description

count()
count() : int
Returns the number of fields stored in the model.

Tags

Since

1.3.0

Returns

int
current()
current()

Return the current element in the Map

Tags

Since

1.0.0

execCallback()
execCallback($cb_def, $value, $key) : mixed

Execute the a callback function on a key/value pair.

Parameters

$cb_defMixed

The callback definition

$valuemixed

The current value of the element.

$keystring

The key name of the element.

Returns

mixed
exportHMV()
exportHMV($ignore_empty = false, $export_all = false, $obj = null) : array
Export the mdel in HazaarModelView format for easy display in views.

Tags

Since

2.0.0

Parameters

$ignore_empty

No description

$export_all

No description

$obj

No description

Returns

array

The array of values stored in the model in key => (label, value) tuples. Returns NULL if model is empty.

exportHMVArray()
exportHMVArray($array, $def, $hide_empty = false, $export_all = false, $object = null) : array
Exports and array in HazaarModelView format using the supplied definition

Tags

Since

2.0.0

Parameters

$arraymixed

The array to convert and export.

$defmixed

The strict model definition.

$hide_empty

No description

$export_all

No description

$object

No description

Returns

array

The array of values in key => (label, value) tuples. Returns NULL if first parameter is not an array.

extend()
extend($values, $run_callbacks = true, $ignore_keys = null)

Parameters

$values

No description

$run_callbacks

No description

$ignore_keys

No description

get()
get($key, $run_callbacks = true)

Parameters

$key

No description

$run_callbacks

No description

getDefinition()
getDefinition($key)

Parameters

$key

No description

getType()
getType($key)

Parameters

$key

No description

has()
has($key)

Parameters

$key

No description

isObject()
isObject($key)

Parameters

$key

No description

key()
key()

Return the current key from the Map

Tags

Since

1.0.0

label()
label()
loadDefinition()
loadDefinition($field_definition)

Parameters

$field_definitionarray

No description

next()
next()

Move to the next element in the Map

Tags

Since

1.0.0

offsetExists()
offsetExists($offset)
Array Access Methods

Parameters

$offset

No description

offsetGet()
offsetGet($offset)

Parameters

$offset

No description

offsetSet()
offsetSet($offset, $value)

Parameters

$offset

No description

$value

No description

offsetUnset()
offsetUnset($offset)

Parameters

$offset

No description

populate()
populate($data, $exec_filters = false)

Parameters

$data

No description

$exec_filters

No description

prepare()
prepare($data)

Parameters

$data

No description

resolveArray()
resolveArray($array, $disable_callbacks = false, $depth = null, $show_hidden = false)

Parameters

$array

No description

$disable_callbacks

No description

$depth

No description

$show_hidden

No description

rewind()
rewind()

Set the internal pointer the first element

Tags

Since

1.0.0

set()
set($key, $value, $run_callbacks = true)

Parameters

$key

No description

$value

No description

$run_callbacks

No description

toArray()
toArray($disable_callbacks = false, $depth = null, $show_hidden = false)
Convert data into an array

If field values are Strict models, then convert them to arrays as well.

Tags

Since

1.0.0

Parameters

$disable_callbacks

No description

$depth

No description

$show_hidden

No description

valid()
valid()

Test that an element exists at the current internal pointer position

Tags

Since

1.0.0