Sledgehammer Framework

Wrapper extends Base
in package
implements ArrayAccess, Iterator

Wrap the object/array into container object Allow filters and accesscontrol to any object or array.

Tags
see
Readonly

for an example implementation.

Interfaces, Classes, Traits and Enums

ArrayAccess
Iterator

Table of Contents

$_data  : object|array<string|int, mixed>
The wrapped object or array.
$_recursive  : bool
Wrap elements that are object or arrays.
__call()  : mixed
Call a method.
__callStatic()  : mixed
Report that the $method doesn't exist.
__construct()  : mixed
Constructor.
__get()  : mixed
Retrieve a property.
__set()  : mixed
Set a property.
__toString()  : string
The object is used as an string.
current()  : mixed
Iterator: Retrieve the current element.
key()  : string|int
Iterator: Retrieve the current key.
next()  : mixed
Iterator: Move the next element.
offsetExists()  : mixed
ArrayAccess: Check if an index exists.
offsetGet()  : mixed
ArrayAccess: Retrieve an element.
offsetSet()  : mixed
ArrayAccess: Set an element.
offsetUnset()  : mixed
ArrayAccess: Remove an element.
rewind()  : mixed
Iterator: Rewind the iterator to the first element.
valid()  : bool
Iterator: Returns false when the end of the iterator is reached.
in()  : mixed
Process the value before it's going in (is being set into the wrapped object).
out()  : mixed
Process the value that is going out (is being retrieved from the wrapped object).

Properties

$_data

The wrapped object or array.

protected object|array<string|int, mixed> $_data

$_recursive

Wrap elements that are object or arrays.

private bool $_recursive = true

Methods

__call()

Call a method.

public __call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string
$arguments : array<string|int, mixed>
Return values
mixed

__callStatic()

Report that the $method doesn't exist.

public static __callStatic(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string
$arguments : array<string|int, mixed>
Return values
mixed

__construct()

Constructor.

public __construct(mixed $data[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$data : mixed
$options : array<string|int, mixed> = []
Return values
mixed

__get()

Retrieve a property.

public __get(string $property) : mixed
Parameters
$property : string
Return values
mixed

__set()

Set a property.

public __set(string $property, mixed $value) : mixed
Parameters
$property : string
$value : mixed
Return values
mixed

__toString()

The object is used as an string.

public __toString() : string
Return values
string

current()

Iterator: Retrieve the current element.

public current() : mixed
Return values
mixed

key()

Iterator: Retrieve the current key.

public key() : string|int
Return values
string|int

next()

Iterator: Move the next element.

public next() : mixed
Return values
mixed

offsetExists()

ArrayAccess: Check if an index exists.

public offsetExists(string $index) : mixed
Parameters
$index : string
Return values
mixed

offsetGet()

ArrayAccess: Retrieve an element.

public offsetGet(string $key) : mixed
Parameters
$key : string
Return values
mixed

offsetSet()

ArrayAccess: Set an element.

public offsetSet(string $key, mixed $value) : mixed
Parameters
$key : string
$value : mixed
Return values
mixed

offsetUnset()

ArrayAccess: Remove an element.

public offsetUnset(string $index) : mixed
Parameters
$index : string
Return values
mixed

rewind()

Iterator: Rewind the iterator to the first element.

public rewind() : mixed
Return values
mixed

valid()

Iterator: Returns false when the end of the iterator is reached.

public valid() : bool
Return values
bool

in()

Process the value before it's going in (is being set into the wrapped object).

protected in(mixed $value, string $element, mixed $context) : mixed
Parameters
$value : mixed
$element : string
$context : mixed
Return values
mixed

out()

Process the value that is going out (is being retrieved from the wrapped object).

protected out(mixed $value, string $element, mixed $context) : mixed
Parameters
$value : mixed
$element : string
$context : mixed
Return values
mixed

Search results