Skip to content

DataContainer

Properties

parent

protected ?\Qubus\Support\DataContainer $parent

parentEnabled

protected bool $parentEnabled

data

protected array $data

readOnly

protected bool $readOnly

isModified

public bool $isModified

dataType

public \Qubus\Support\DataObjectCollection $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.

public getParent(): \Qubus\Support\DataContainer

setParent

Set the parent of this container, to support inheritance.

public setParent(\Qubus\Support\DataContainer|null $parent = null): $this

Parameters:

Parameter Type Description
$parent \Qubus\Support\DataContainer|null the parent container object

enableParent

Enable the use of the parent object, if set.

public enableParent(): $this

disableParent

Disable the use of the parent object.

public disableParent(): $this

hasParent

Check whether this container has an active parent.

public hasParent(): bool

setContents

Replace the container's data.

public setContents(array $data): $this

Parameters:

Parameter Type Description
$data array new data

Throws:


getContents

Get the container's data.

public getContents(): array

Return Value:

container's data

Throws:


setReadOnly

Set whether the container is read-only.

public setReadOnly(bool $readOnly = true): $this

Parameters:

Parameter Type Description
$readOnly bool whether it's a read-only container

merge

Merge arrays into the container.

public merge(array $arg): $this

Parameters:

Parameter Type Description
$arg array array to merge with

Throws:


isReadOnly

Check whether the container is read-only.

public isReadOnly(): bool

Return Value:

$readOnly whether it's a read-only container


__isset

isset magic method

public __isset(mixed $key): mixed

Parameters:

Parameter Type Description
$key mixed

Throws:


has

Check if a key was set upon this bag's data

public has(string $key): bool

Parameters:

Parameter Type Description
$key string

Throws:


__get

get magic method

public __get(mixed $key): mixed

Parameters:

Parameter Type Description
$key mixed

Throws:


get

Get a key's value from the container.

public get(?string $key = null, mixed $default = null): mixed

Parameters:

Parameter Type Description
$key ?string
$default mixed

Throws:


__set

set magic method

public __set(mixed $key, mixed $value): mixed

Parameters:

Parameter Type Description
$key mixed
$value mixed

set

Set a config value.

public set(?string $key, mixed $value): static

Parameters:

Parameter Type Description
$key ?string
$value mixed

Throws:


delete

Delete data from the container.

public delete(string $key): bool

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.

public offsetExists(string $offset): bool

Parameters:

Parameter Type Description
$offset string

Throws:


offsetGet

Allow fetching values as an array.

public offsetGet(string $offset): mixed

Parameters:

Parameter Type Description
$offset string

Throws:


offsetSet

Disallow setting values like an array.

public offsetSet(string $offset, mixed $value): void

Parameters:

Parameter Type Description
$offset string
$value mixed

offsetUnset

Disallow unsetting values like an array.

public offsetUnset(string $offset): void

Parameters:

Parameter Type Description
$offset string

Throws:


getIterator

IteratorAggregate implementation.

public getIterator(): \ArrayIterator

Return Value:

iterator

Throws:


count

Countable implementation.

public count(): int

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.

public result(mixed $val): mixed

Parameters:

Parameter Type Description
$val mixed

Return Value:

closure result



Automatically generated on 2025-10-13