Documentation

RecursiveArrayAccess
in package
implements ArrayAccess, Countable, Iterator

Wrapper class for the recursive array

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

ss4u ss4u.comvation@gmail.com

version
3.1.2
subpackage

core

see
Session

Table of Contents

Interfaces

ArrayAccess
Countable
Iterator

Properties

$callableOnGet  : callable
Callable funtion on offsetGet
$callableOnSanitizeKey  : callable
Callable function on callableOnSanitizeKey
$callableOnSet  : callable
Callable funtion on offsetSet
$callableOnUnset  : callable
Callable funtion on offsetUnset
$callableOnValidateKey  : callable
Callable function on callableOnValidateKey
$data  : array<string|int, mixed>
Internal data array.
$dirt  : array<string|int, mixed>
$id  : int
$offset  : string
Path of the current array
$parentId  : int

Methods

__construct()  : mixed
Default object constructor.
clean()  : mixed
Empties the offset with values which were changed.
count()  : int
Get the count of elements in the container array.
current()  : mixed
Current position of the array.
isDirty()  : bool
Checks if a value is dirty.
key()  : mixed
Key of the current element.
next()  : void
Move the internal point of the container array to the next item
offsetExists()  : bool
check a offset exists
offsetGet()  : mixed
Offset to retrieve
offsetSet()  : void
Offset to set
offsetUnset()  : null
Offset to unset
pollute()  : mixed
Pollutes a value.
recursiveOffsetExists()  : bool
This function checks if the value of an array-index, which is not on first level of the main array, is set e.g $array['level1']['level2']['level3']
recursiveOffsetGet()  : mixed
This function returns the value of an array-index which is not on first level of the main array e.g $array['level1']['level2']['level3']
recursiveOffsetSet()  : mixed
This function sets the value of an array-index which is not on first level of the main array e.g $array['level1']['level2']['level3'] If the previous index i.e ['level1'] is not set it will be set to array.
rewind()  : void
Rewind the internal point of the container array.
toArray()  : array<string|int, mixed>
Output the data as a multidimensional array.
valid()  : bool
Is the current key valid?

Properties

Methods

__construct()

Default object constructor.

public __construct(array<string|int, mixed> $data[, string $offset = '' ][, int $parentId = 0 ][, callable $callableOnSet = null ][, callable $callableOnGet = null ][, callable $callableOnUnset = null ][, callable $callableOnValidateKey = null ]) : mixed
Parameters
$data : array<string|int, mixed>
$offset : string = ''
$parentId : int = 0
$callableOnSet : callable = null
$callableOnGet : callable = null
$callableOnUnset : callable = null
$callableOnValidateKey : callable = null

clean()

Empties the offset with values which were changed.

public clean(mixed $offset) : mixed
Parameters
$offset : mixed

isDirty()

Checks if a value is dirty.

public isDirty(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetSet()

Offset to set

public offsetSet(mixed $offset, mixed $data[, null $callableOnSet = null ][, null $callableOnGet = null ][, null $callableOnUnset = null ][, null $callableOnValidateKey = null ]) : void
Parameters
$offset : mixed

The offset to assign the value to.

$data : mixed

The value to set.

$callableOnSet : null = null
$callableOnGet : null = null
$callableOnUnset : null = null
$callableOnValidateKey : null = null
Tags
link
http://php.net/manual/en/arrayaccess.offsetset.php

recursiveOffsetExists()

This function checks if the value of an array-index, which is not on first level of the main array, is set e.g $array['level1']['level2']['level3']

public recursiveOffsetExists(string $offset[, string $delimiter = '/' ]) : bool
Parameters
$offset : string

string containing the offset e.g 'level1/level2/level3'

$delimiter : string = '/'

the delimiter used in $offset e.g '/'

Tags
throws
RecursiveArrayAccessException
Return values
bool

recursiveOffsetGet()

This function returns the value of an array-index which is not on first level of the main array e.g $array['level1']['level2']['level3']

public recursiveOffsetGet(string $offset[, string $delimiter = '/' ]) : mixed
Parameters
$offset : string

string containing the offset e.g 'level1/level2/level3'

$delimiter : string = '/'

the delimiter used in $offset e.g '/'

Tags
access

public

throws
RecursiveArrayAccessException
Return values
mixed

value of the array index

recursiveOffsetSet()

This function sets the value of an array-index which is not on first level of the main array e.g $array['level1']['level2']['level3'] If the previous index i.e ['level1'] is not set it will be set to array.

public recursiveOffsetSet(mixed $value, string $offset[, string $delimiter = '/' ]) : mixed

Note: If it is set but not an array it will be overwritten

Parameters
$value : mixed

the value which should be set

$offset : string

string containing the offset e.g 'level1/level2/level3'

$delimiter : string = '/'

the delimiter used in $offset e.g '/'

Tags
access

public

toArray()

Output the data as a multidimensional array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results