Fragment extends Collection
FinalYes
Table of Contents
Methods
- __construct() : mixed
- Creates object.
- addError() : mixed
- addException() : mixed
- addNode() : mixed
- clear() : mixed
- containsKey() : mixed
- count() : int
- Count elements of an object
- delete() : $this
- Delete several items by condition
- deleteOne() : mixed
- excludeSubTreeFragment() : mixed
- export() : mixed
- find() : static
- Find items by condition. A new collection of the same class will be returned
- findOne() : mixed
- first() : mixed
- get() : null
- Returns item by it`s value (key). Keys MAY NOT be numeric, so it is NOT an order-correct query
- getChildrenCount() : mixed
- getClass() : mixed
- getData() : mixed
- getErrors() : mixed
- getIds() : mixed
- getIterator() : Traversable
- getKeys() : mixed
- getNode() : mixed
- getNodeData() : mixed
- getSubTree() : mixed
- includeFragment() : mixed
- includeSubTreeFragment() : mixed
- isA() : mixed
- isCorrect() : bool
- Returns true, if there are no cycles and insanely deep nodes, and other possible errors
- isEmpty() : bool
- Returns true if the dictionary is empty.
- isSuccess() : mixed
- last() : mixed
- nth() : mixed
- offsetExists() : bool
- Whether a offset exists
- offsetGet() : mixed
- Returns instance field. If none was loaded before, upload it.
- offsetSet() : void
- Offset to set
- offsetUnset() : void
- Offset to unset
- push() : mixed
- set() : mixed
- setParentFor() : mixed
- sort() : static
- Sorts this collection by $conditions
- toArray() : array<string|int, mixed>
- Returns the values as an array.
- unShift() : mixed
- update() : mixed
- updateOne() : mixed
- walkDepth() : mixed
- walkWidth() : mixed
Methods
__construct()
Creates object.
public
__construct([array<string|int, mixed> $values = null ]) : mixed
Parameters
- $values : array<string|int, mixed> = null
addError()
public
addError(mixed $code, mixed $message[, mixed $type = Error::TYPE_FATAL ][, mixed $data = null ]) : mixed
Parameters
- $code : mixed
- $message : mixed
- $type : mixed = Error::TYPE_FATAL
- $data : mixed = null
addException()
public
addException(mixed $e[, string $message = '' ][, array<string|int, mixed> $settings = array() ]) : mixed
Parameters
- $e : mixed
- $message : string = ''
- $settings : array<string|int, mixed> = array()
addNode()
public
addNode(mixed $id, mixed $parentId[, mixed $data = array() ]) : mixed
Parameters
- $id : mixed
- $parentId : mixed
- $data : mixed = array()
clear()
public
clear() : mixed
containsKey()
public
containsKey(mixed $key) : mixed
Parameters
- $key : mixed
count()
Count elements of an object
public
count() : int
Return values
intdelete()
Delete several items by condition
public
delete(mixed $conditions[, int $limit = -1 ]) : $this
Parameters
- $conditions : mixed
- $limit : int = -1
Return values
$thisdeleteOne()
public
deleteOne(array<string|int, mixed> $conditions) : mixed
Parameters
- $conditions : array<string|int, mixed>
excludeSubTreeFragment()
public
excludeSubTreeFragment(mixed $id[, array<string|int, mixed> $settings = array() ]) : mixed
Parameters
- $id : mixed
- $settings : array<string|int, mixed> = array()
export()
public
export([mixed $exporter = null ]) : mixed
Parameters
- $exporter : mixed = null
find()
Find items by condition. A new collection of the same class will be returned
public
find([array<string|int, mixed> $conditions = array() ][, array<string|int, mixed>|int $limit = -1 ]) : static
Parameters
- $conditions : array<string|int, mixed> = array()
- $limit : array<string|int, mixed>|int = -1
Return values
staticfindOne()
public
findOne([mixed $conditions = array() ]) : mixed
Parameters
- $conditions : mixed = array()
first()
public
first() : mixed
get()
Returns item by it`s value (key). Keys MAY NOT be numeric, so it is NOT an order-correct query
public
get(mixed $name) : null
Parameters
- $name : mixed
Return values
nullgetChildrenCount()
public
getChildrenCount(mixed $id) : mixed
Parameters
- $id : mixed
getClass()
public
static getClass() : mixed
getData()
public
getData() : mixed
getErrors()
public
getErrors() : mixed
getIds()
public
getIds() : mixed
getIterator()
public
getIterator() : Traversable
Return values
TraversablegetKeys()
public
getKeys() : mixed
getNode()
public
getNode(mixed $id) : mixed
Parameters
- $id : mixed
getNodeData()
public
getNodeData(mixed $id) : mixed
Parameters
- $id : mixed
getSubTree()
public
getSubTree([mixed $point = 0 ]) : mixed
Parameters
- $point : mixed = 0
includeFragment()
public
includeFragment(static|array<string|int, mixed> $fragment) : mixed
Parameters
- $fragment : static|array<string|int, mixed>
includeSubTreeFragment()
public
includeSubTreeFragment(static|array<string|int, mixed> $fragment[, mixed $parentId = 0 ]) : mixed
Parameters
- $fragment : static|array<string|int, mixed>
- $parentId : mixed = 0
Tags
isA()
public
static isA(mixed $object) : mixed
Parameters
- $object : mixed
isCorrect()
Returns true, if there are no cycles and insanely deep nodes, and other possible errors
public
isCorrect() : bool
Return values
boolisEmpty()
Returns true if the dictionary is empty.
public
isEmpty() : bool
Return values
boolisSuccess()
public
isSuccess() : mixed
last()
public
last() : mixed
nth()
public
nth(mixed $num) : mixed
Parameters
- $num : mixed
offsetExists()
Whether a offset exists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
Returns instance field. If none was loaded before, upload it.
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Attributes
- #[ReturnTypeWillChange]
offsetSet()
Offset to set
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
Offset to unset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
push()
public
push(mixed $data) : mixed
Parameters
- $data : mixed
set()
public
set(array<string|int, mixed> $values) : mixed
Parameters
- $values : array<string|int, mixed>
setParentFor()
public
setParentFor(mixed $id, mixed $newParentId) : mixed
Parameters
- $id : mixed
- $newParentId : mixed
sort()
Sorts this collection by $conditions
public
sort([array<string|int, mixed> $conditions = array() ]) : static
Parameters
- $conditions : array<string|int, mixed> = array()
-
todo: only one sort parameter supported todo: implement option "nulls first\last" to be able to preserve original order for items that do not have todo: criteria offset at all
Return values
statictoArray()
Returns the values as an array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>unShift()
public
unShift(mixed $data) : mixed
Parameters
- $data : mixed
update()
public
update(array<string|int, mixed> $conditions, mixed $data[, mixed $limit = -1 ]) : mixed
Parameters
- $conditions : array<string|int, mixed>
- $data : mixed
- $limit : mixed = -1
updateOne()
public
updateOne(array<string|int, mixed> $conditions, mixed $data) : mixed
Parameters
- $conditions : array<string|int, mixed>
- $data : mixed
walkDepth()
public
walkDepth(mixed $cb) : mixed
Parameters
- $cb : mixed
walkWidth()
public
walkWidth(mixed $cb[, mixed $rootId = 0 ]) : mixed
Parameters
- $cb : mixed
- $rootId : mixed = 0