W3cubDocs

/Symfony 4.1

Data

class Data implements ArrayAccess, Countable, IteratorAggregate

Methods

__construct(array $data)
string getType()
string|int|float|bool|array|Data[]|null getValue(bool $recursive = false)
count()
getIterator()
__get($key)
__isset($key)
offsetExists($key)
offsetGet($key)
offsetSet($key, $value)
offsetUnset($key)
__toString()
Data withMaxDepth(int $maxDepth)

Returns a depth limited clone of $this.

Data withMaxItemsPerDepth(int $maxItemsPerDepth)

Limits the number of elements per depth level.

Data withRefHandles(bool $useRefHandles)

Enables/disables objects' identifiers tracking.

Data|null seek(string|int $key)

Seeks to a specific key in nested data structures.

dump(DumperInterface $dumper)

Dumps data with a DumperInterface dumper.

Details

__construct(array $data)

Parameters

array $data An array as returned by ClonerInterface::cloneVar()

string getType()

Return Value

string The type of the value

string|int|float|bool|array|Data[]|null getValue(bool $recursive = false)

Parameters

bool $recursive Whether values should be resolved recursively or not

Return Value

string|int|float|bool|array|Data[]|null A native representation of the original value

count()

getIterator()

__get($key)

Parameters

$key

__isset($key)

Parameters

$key

offsetExists($key)

Parameters

$key

offsetGet($key)

Parameters

$key

offsetSet($key, $value)

Parameters

$key
$value

offsetUnset($key)

Parameters

$key

__toString()

Data withMaxDepth(int $maxDepth)

Returns a depth limited clone of $this.

Parameters

int $maxDepth The max dumped depth level

Return Value

Data A clone of $this

Data withMaxItemsPerDepth(int $maxItemsPerDepth)

Limits the number of elements per depth level.

Parameters

int $maxItemsPerDepth The max number of items dumped per depth level

Return Value

Data A clone of $this

Data withRefHandles(bool $useRefHandles)

Enables/disables objects' identifiers tracking.

Parameters

bool $useRefHandles False to hide global ref. handles

Return Value

Data A clone of $this

Data|null seek(string|int $key)

Seeks to a specific key in nested data structures.

Parameters

string|int $key The key to seek to

Return Value

Data|null A clone of $this or null if the key is not set

dump(DumperInterface $dumper)

Dumps data with a DumperInterface dumper.

Parameters

DumperInterface $dumper

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/VarDumper/Cloner/Data.html