SimpleDataStore
in package
implements
JsonSerializable
Uses
TArrayTools
Interfaces, Classes, Traits and Enums
- JsonSerializable
Table of Contents
- $TYPE_ARRAY : mixed
- $TYPE_BOOLEAN : mixed
- $TYPE_INTEGER : mixed
- $TYPE_NULL : mixed
- $TYPE_SERIALIZABLE : mixed
- $TYPE_STRING : mixed
- $data : array<string|int, mixed>
- __construct() : mixed
- SimpleDataStore constructor.
- a() : SimpleDataStore
- aArray() : SimpleDataStore
- aBool() : SimpleDataStore
- aData() : $this
- aInt() : SimpleDataStore
- aObj() : SimpleDataStore
- default() : void
- g() : string
- gAll() : array<string|int, mixed>
- gArray() : array<string|int, mixed>
- gBool() : bool
- gData() : SimpleDataStore
- gInt() : int
- gItem() : mixed
- gObj() : null|JsonSerializable
- gObjs() : array<string|int, JsonSerializable>
- hasKey() : bool
- hasKeys() : bool
- haveKey() : bool
- haveKeys() : bool
- json() : $this
- jsonSerialize() : array<string|int, mixed>
- keys() : array<string|int, mixed>
- obj() : $this
- s() : SimpleDataStore
- sAll() : SimpleDataStore
- sArray() : SimpleDataStore
- sBool() : SimpleDataStore
- sData() : $this
- sInt() : SimpleDataStore
- sObj() : SimpleDataStore
- typeOf() : string
- u() : $this
- validKey() : bool
- cleanArray() : mixed
- extractArray() : mixed
- get() : string
- getArray() : array<string|int, mixed>
- getBool() : bool
- getFloat() : float
- getInt() : int
- getList() : array<string|int, mixed>
- getObj() : mixed
- mustContains() : mixed
Properties
$TYPE_ARRAY
public
static mixed
$TYPE_ARRAY
= 'Array'
$TYPE_BOOLEAN
public
static mixed
$TYPE_BOOLEAN
= 'Boolean'
$TYPE_INTEGER
public
static mixed
$TYPE_INTEGER
= 'Integer'
$TYPE_NULL
public
static mixed
$TYPE_NULL
= 'Null'
$TYPE_SERIALIZABLE
public
static mixed
$TYPE_SERIALIZABLE
= 'Serializable'
$TYPE_STRING
public
static mixed
$TYPE_STRING
= 'String'
$data
private
array<string|int, mixed>
$data
Methods
__construct()
SimpleDataStore constructor.
public
__construct([array<string|int, mixed>|null $data = [] ]) : mixed
Parameters
- $data : array<string|int, mixed>|null = []
Return values
mixed —a()
public
a(string $key, string $value) : SimpleDataStore
Parameters
- $key : string
- $value : string
Return values
SimpleDataStore —aArray()
public
aArray(string $key, array<string|int, mixed> $values) : SimpleDataStore
Parameters
- $key : string
- $values : array<string|int, mixed>
Return values
SimpleDataStore —aBool()
public
aBool(string $key, bool $value) : SimpleDataStore
Parameters
- $key : string
- $value : bool
Return values
SimpleDataStore —aData()
public
aData(string $key, SimpleDataStore $data) : $this
Parameters
- $key : string
- $data : SimpleDataStore
Return values
$this —aInt()
public
aInt(string $key, int $value) : SimpleDataStore
Parameters
- $key : string
- $value : int
Return values
SimpleDataStore —aObj()
public
aObj(string $key, JsonSerializable $value) : SimpleDataStore
Parameters
- $key : string
- $value : JsonSerializable
Return values
SimpleDataStore —default()
public
default([array<string|int, mixed> $default = [] ]) : void
Parameters
- $default : array<string|int, mixed> = []
Return values
void —g()
public
g(string $key) : string
Parameters
- $key : string
Return values
string —gAll()
public
gAll() : array<string|int, mixed>
Return values
array<string|int, mixed> —gArray()
public
gArray(string $key) : array<string|int, mixed>
Parameters
- $key : string
Return values
array<string|int, mixed> —gBool()
public
gBool(string $key) : bool
Parameters
- $key : string
Return values
bool —gData()
public
gData(string $key) : SimpleDataStore
Parameters
- $key : string
Return values
SimpleDataStore —gInt()
public
gInt(string $key) : int
Parameters
- $key : string
Return values
int —gItem()
public
gItem(string $key) : mixed
Parameters
- $key : string
Tags
Return values
mixed —gObj()
public
gObj(string $key[, string $class = '' ]) : null|JsonSerializable
Parameters
- $key : string
- $class : string = ''
Tags
Return values
null|JsonSerializable —gObjs()
public
gObjs(string $key[, string $class = '' ]) : array<string|int, JsonSerializable>
Parameters
- $key : string
- $class : string = ''
Return values
array<string|int, JsonSerializable> —hasKey()
public
hasKey(string $key) : bool
Parameters
- $key : string
Return values
bool —hasKeys()
public
hasKeys(array<string|int, mixed> $keys[, bool $must = false ]) : bool
Parameters
- $keys : array<string|int, mixed>
- $must : bool = false
Tags
Return values
bool —haveKey()
public
haveKey(string $key) : bool
Parameters
- $key : string
Tags
Return values
bool —haveKeys()
public
haveKeys(array<string|int, mixed> $keys[, bool $must = false ]) : bool
Parameters
- $keys : array<string|int, mixed>
- $must : bool = false
Tags
Return values
bool —json()
public
json(string $json) : $this
Parameters
- $json : string
Return values
$this —jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —keys()
public
keys() : array<string|int, mixed>
Return values
array<string|int, mixed> —obj()
public
obj(JsonSerializable $obj) : $this
Parameters
- $obj : JsonSerializable
Return values
$this —s()
public
s(string $key, string $value) : SimpleDataStore
Parameters
- $key : string
- $value : string
Return values
SimpleDataStore —sAll()
public
sAll(array<string|int, mixed> $data) : SimpleDataStore
Parameters
- $data : array<string|int, mixed>
Return values
SimpleDataStore —sArray()
public
sArray(string $key, array<string|int, mixed> $values) : SimpleDataStore
Parameters
- $key : string
- $values : array<string|int, mixed>
Return values
SimpleDataStore —sBool()
public
sBool(string $key, bool $value) : SimpleDataStore
Parameters
- $key : string
- $value : bool
Return values
SimpleDataStore —sData()
public
sData(string $key, SimpleDataStore $data) : $this
Parameters
- $key : string
- $data : SimpleDataStore
Return values
$this —sInt()
public
sInt(string $key, int $value) : SimpleDataStore
Parameters
- $key : string
- $value : int
Return values
SimpleDataStore —sObj()
public
sObj(string $key, JsonSerializable $value) : SimpleDataStore
Parameters
- $key : string
- $value : JsonSerializable
Return values
SimpleDataStore —typeOf()
public
typeOf(string $key, array<string|int, mixed> $arr[, bool $root = true ]) : string
Parameters
- $key : string
- $arr : array<string|int, mixed>
- $root : bool = true
Tags
Return values
string —u()
public
u(string $key) : $this
Parameters
- $key : string
Return values
$this —validKey()
public
validKey(string $k, array<string|int, mixed> $arr) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
Return values
bool —cleanArray()
protected
cleanArray(array<string|int, mixed> &$arr) : mixed
Parameters
- $arr : array<string|int, mixed>
Return values
mixed —extractArray()
protected
extractArray(string $k, string $value, array<string|int, mixed> $list) : mixed
Parameters
- $k : string
- $value : string
- $list : array<string|int, mixed>
Tags
Return values
mixed —get()
protected
get(string $k, array<string|int, mixed> $arr[, string $default = '' ]) : string
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : string = ''
Return values
string —getArray()
protected
getArray(string $k, array<string|int, mixed> $arr[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getBool()
protected
getBool(string $k, array<string|int, mixed> $arr[, bool $default = false ]) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : bool = false
Return values
bool —getFloat()
protected
getFloat(string $k, array<string|int, mixed> $arr, float $default) : float
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : float
Return values
float —getInt()
protected
getInt(string $k, array<string|int, mixed> $arr, int $default) : int
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : int
Return values
int —getList()
protected
getList(string $k, array<string|int, mixed> $arr, array<string|int, mixed> $import[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $import : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getObj()
protected
getObj(string $k, array<string|int, mixed> $arr[, JsonSerializable|null $default = null ]) : mixed
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : JsonSerializable|null = null
Return values
mixed —mustContains()
protected
mustContains(array<string|int, mixed> $keys, array<string|int, mixed> $arr) : mixed
Parameters
- $keys : array<string|int, mixed>
- $arr : array<string|int, mixed>