Data
in package
implements
DataInterface, ArrayAccess
Tags
Table of Contents
Interfaces
- DataInterface
- ArrayAccess
Constants
- DELIMITERS = ['.', '/']
Properties
- $data : array<string, mixed>
- Internal representation of data data
Methods
- __construct() : mixed
- Constructor
- append() : void
- Append a value to a key (assumes key refers to an array value)
- export() : array<string, mixed>
- Export data as raw data
- get() : mixed
- Get the raw value for a key
- getData() : DataInterface
- Get a data instance for a key
- has() : bool
- Check if the key exists
- import() : void
- Import data into existing data
- importData() : void
- Import data from an external data into existing data
- offsetExists() : bool
- {@inheritdoc}
- offsetGet() : mixed
- {@inheritdoc}
- offsetSet() : void
- {@inheritdoc}
- offsetUnset() : void
- {@inheritdoc}
- remove() : void
- Remove a key
- set() : void
- Set a value for a key
- formatPath() : string
- keyToPathArray() : array<string|int, string>
Constants
DELIMITERS
private
mixed
DELIMITERS
= ['.', '/']
Properties
$data
Internal representation of data data
protected
array<string, mixed>
$data
Methods
__construct()
Constructor
public
__construct([array<string, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string, mixed> = []
append()
Append a value to a key (assumes key refers to an array value)
public
append(string $key[, mixed $value = null ]) : void
Parameters
- $key : string
- $value : mixed = null
export()
Export data as raw data
public
export() : array<string, mixed>
Tags
Return values
array<string, mixed>get()
Get the raw value for a key
public
get(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Tags
getData()
Get a data instance for a key
public
getData(string $key) : DataInterface
Parameters
- $key : string
Tags
Return values
DataInterfacehas()
Check if the key exists
public
has(string $key) : bool
Parameters
- $key : string
Tags
Return values
boolimport()
Import data into existing data
public
import(array<string|int, mixed> $data[, int $mode = self::REPLACE ]) : void
Parameters
- $data : array<string|int, mixed>
- $mode : int = self::REPLACE
importData()
Import data from an external data into existing data
public
importData(DataInterface $data[, int $mode = self::REPLACE ]) : void
Parameters
- $data : DataInterface
- $mode : int = self::REPLACE
offsetExists()
{@inheritdoc}
public
offsetExists(mixed $key) : bool
Parameters
- $key : mixed
Attributes
- #[ReturnTypeWillChange]
Return values
booloffsetGet()
{@inheritdoc}
public
offsetGet(mixed $key) : mixed
Parameters
- $key : mixed
Attributes
- #[ReturnTypeWillChange]
offsetSet()
{@inheritdoc}
public
offsetSet(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
Attributes
- #[ReturnTypeWillChange]
offsetUnset()
{@inheritdoc}
public
offsetUnset(mixed $key) : void
Parameters
- $key : mixed
Attributes
- #[ReturnTypeWillChange]
remove()
Remove a key
public
remove(string $key) : void
Parameters
- $key : string
set()
Set a value for a key
public
set(string $key[, mixed $value = null ]) : void
Parameters
- $key : string
- $value : mixed = null
formatPath()
protected
static formatPath(string|array<string|int, string> $path) : string
Parameters
- $path : string|array<string|int, string>
Tags
Return values
stringkeyToPathArray()
protected
static keyToPathArray(string $path) : array<string|int, string>
Parameters
- $path : string