DataContainer
- Full name:
\Qubus\Support\DataContainer
- This class implements:
\ArrayAccess
,\IteratorAggregate
,\Countable
Properties
parent
parentEnabled
data
readOnly
isModified
dataType
Methods
__construct
Constructor
public __construct(\Qubus\Support\DataObjectCollection $dataType, array $data = [], bool $readOnly = false): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$dataType | \Qubus\Support\DataObjectCollection | String or Array data type. |
$data | array | Container data. |
$readOnly | bool | Whether the container is read-only. |
getParent
Get the parent of this container.
setParent
Set the parent of this container, to support inheritance.
Parameters:
Parameter | Type | Description |
---|---|---|
$parent | \Qubus\Support\DataContainer|null | the parent container object |
enableParent
Enable the use of the parent object, if set.
disableParent
Disable the use of the parent object.
hasParent
Check whether this container has an active parent.
setContents
Replace the container's data.
Parameters:
Parameter | Type | Description |
---|---|---|
$data | array | new data |
Throws:
getContents
Get the container's data.
Return Value:
container's data
Throws:
setReadOnly
Set whether the container is read-only.
Parameters:
Parameter | Type | Description |
---|---|---|
$readOnly | bool | whether it's a read-only container |
merge
Merge arrays into the container.
Parameters:
Parameter | Type | Description |
---|---|---|
$arg | array | array to merge with |
Throws:
isReadOnly
Check whether the container is read-only.
Return Value:
$readOnly whether it's a read-only container
__isset
isset magic method
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
Throws:
has
Check if a key was set upon this bag's data
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
Throws:
__get
get magic method
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed |
Throws:
get
Get a key's value from the container.
Parameters:
Parameter | Type | Description |
---|---|---|
$key | ?string | |
$default | mixed |
Throws:
__set
set magic method
Parameters:
Parameter | Type | Description |
---|---|---|
$key | mixed | |
$value | mixed |
set
Set a config value.
Parameters:
Parameter | Type | Description |
---|---|---|
$key | ?string | |
$value | mixed |
Throws:
delete
Delete data from the container.
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | key to delete. |
Return Value:
delete success bool
offsetExists
Allow usage of isset() on the param bag as an array.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset | string |
Throws:
offsetGet
Allow fetching values as an array.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset | string |
Throws:
offsetSet
Disallow setting values like an array.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset | string | |
$value | mixed |
offsetUnset
Disallow unsetting values like an array.
Parameters:
Parameter | Type | Description |
---|---|---|
$offset | string |
Throws:
getIterator
IteratorAggregate implementation.
Return Value:
iterator
Throws:
count
Countable implementation.
Return Value:
number of items stored in the container
Throws:
result
Checks if a return value is a Closure without params, and if so executes it before returning it.
Parameters:
Parameter | Type | Description |
---|---|---|
$val | mixed |
Return Value:
closure result
Automatically generated on 2025-10-13