Documentation

DataInterface

Interface DataInterface

Table of Contents

Methods

blueprints()  : Blueprint
Return blueprints.
extra()  : array<string|int, mixed>
Get extra items which haven't been defined in blueprints.
file()  : FileInterface
Set or get the data storage.
filter()  : $this
Filter all items by using blueprints.
merge()  : mixed
Merge external data.
save()  : void
Save data into the file.
validate()  : $this
Validate by blueprints.
value()  : mixed
Get value by using dot notation for nested arrays/objects.

Methods

extra()

Get extra items which haven't been defined in blueprints.

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

file()

Set or get the data storage.

public file([FileInterface|null $storage = null ]) : FileInterface
Parameters
$storage : FileInterface|null = null

Optionally enter a new storage.

Return values
FileInterface

filter()

Filter all items by using blueprints.

public filter() : $this
Return values
$this

merge()

Merge external data.

public merge(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>

validate()

Validate by blueprints.

public validate() : $this
Tags
throws
Exception
Return values
$this

value()

Get value by using dot notation for nested arrays/objects.

public value(string $name[, mixed $default = null ][, string $separator = '.' ]) : mixed
Parameters
$name : string

Dot separated path to the requested value.

$default : mixed = null

Default value (or null).

$separator : string = '.'

Separator, defaults to '.'

Tags
example

$value = $data->value('this.is.my.nested.variable');

Return values
mixed

Value.


        
On this page

Search results