Collection
class Collection extends SimpleCollection
Class DataCollector - 数据收集器 (数据存储器 - DataStorage) complex deep
Constants
FORMAT_JSON |
|
FORMAT_PHP |
|
FORMAT_INI |
|
FORMAT_YML |
|
Properties
protected array | $data | The source data | from SimpleCollection |
protected string | $separator | Property separator. | |
protected string | $name | name | |
static protected array | $formats | formats |
Methods
No description
__construct
set config value by path
get value by path
No description
Clear all data.
Unset an offset in the iterator.
No description
No description
No description
No description
No description
No description
No description
No description
setName
getName
load
No description
load data form yml file
load data form php file or array
load data form php file or array
load data form ini file
load data form json file
No description
No description
No description
No description
No description
parse YAML
Details
at line 94
static SimpleCollection
make(mixed $data = null, string $format = 'php', string $name = 'box1')
at line 78
__construct(mixed $data = null, string $format = 'php', string $name = 'box1')
__construct
in SimpleCollection at line 40
__destruct()
at line 105
set(string $path, $value)
set config value by path
in SimpleCollection at line 67
$this
add($name, $value)
at line 118
get(string $path, $default = null)
get value by path
in SimpleCollection at line 91
replace(array $items)
Add item to collection
in SimpleCollection at line 102
array
gets(array $names)
in SimpleCollection at line 117
SimpleCollection
sets(array $data)
in SimpleCollection at line 130
SimpleCollection
reject(callable $filter)
in SimpleCollection at line 149
SimpleCollection
map(callable $callback)
in SimpleCollection at line 165
string
implode(string $char = ',')
in SimpleCollection at line 174
array
all()
Get all items in collection
in SimpleCollection at line 182
array
toArray()
in SimpleCollection at line 191
array
keys()
Get collection keys
at line 132
bool
has(string $path)
in SimpleCollection at line 211
mixed
remove($key)
Remove item from collection
at line 148
clear()
Clear all data.
in SimpleCollection at line 240
bool
offsetExists(string $key)
Does this collection have a given key?
in SimpleCollection at line 250
mixed
offsetGet(string $key)
Get collection item for key
in SimpleCollection at line 260
offsetSet(string $key, mixed $value)
Set collection item
at line 377
mixed|null
offsetUnset(mixed $offset)
Unset an offset in the iterator.
in SimpleCollection at line 283
int
count()
Get number of items in collection
in SimpleCollection at line 295
array
jsonSerialize()
in SimpleCollection at line 307
string
serialize()
in SimpleCollection at line 316
unserialize(string $serialized, bool|array $allowedClasses = false)
at line 367
ArrayIterator
getIterator()
in SimpleCollection at line 342
mixed
__get($name)
in SimpleCollection at line 347
__set($name, $value)
in SimpleCollection at line 352
__isset($name)
at line 123
exists($path)
at line 137
reset()
at line 157
mixed
toObject($class = \stdClass::class)
at line 165
string
getSeparator()
at line 173
setSeparator(string $separator)
at line 181
static array
getFormats()
at line 191
$this
setName(string $value)
setName
at line 202
string
getName()
getName
at line 215
Collection
load(string|array $data, string $format = 'php')
load
at line 253
static array|mixed
read($file, string $format = self::FORMAT_PHP)
at line 264
Collection
loadYaml($data)
load data form yml file
at line 275
Collection
loadArray(array|string $data)
load data form php file or array
at line 294
Collection
loadObject(mixed $data)
load data form php file or array
at line 308
Collection
loadIni(string $string)
load data form ini file
at line 319
Collection
loadJson($data)
load data form json file
at line 330
protected $this
bindData($parent, $data, bool|false $raw = false)
at line 359
array
getKeys()
at line 382
__clone()
at line 398
static array
parseIni($string, bool $enhancement = false, callable $pathHandler = null, string $fileDir = '')
at line 410
static array
parseJson($data, bool $enhancement = false, callable $pathHandler = null, string $fileDir = '')
at line 423
static array
parseYaml(string|bool $data, bool $enhancement = false, callable $pathHandler = null, string $fileDir = '')
parse YAML