DocNode
MMO\doc\models · 1 symbol · generated 30 Sep 2026
DocNode
DocNode.php:18Base of every node of the documentation model (DocPage, DocSymbol, DocMember, DocParam).
- Namespace
MMO\doc\models- Implements
- iArray, JsonSerializable
- Uses traits
- tArray
Index
| content | ||
| nodeCache | ||
| add($key, $node) | Append a child node under $key. | |
| clear() | Empty the underlying content, keeping the object itself. | |
| compact() | Drop every key whose value is null, '' or [] -- keeps the generated json readable and small. | |
| count() | \Countable::count | |
| defaults() | ||
| Flatten($value) static | ||
| get($key, $default) | Read a key, without the "undefined array key" notice $node['missing'] would raise (tArray::offsetGet returns by reference, so it cannot null-coalesce on its own). | |
| getIterator() | \IteratorAggregate::getIterator | |
| isEmpty() | ||
| jsonSerialize() | ||
| keys() | ||
| loadArray($data) | Load every entry of a plain array into the content, through offsetSet (so any offsetSet() override defined by the class using this trait, e.g. | |
| nodes($key, $class) | Read a key as a list of child nodes, rebuilding each one into $class if it is still a plain array (which is what it is right after json_decode). | |
| offsetExists($key) | \ArrayAccess::offsetExists | |
| offsetGet($key) | \ArrayAccess::offsetGet | |
| offsetSet($key, $value) | Store a value, dropping whatever nodes had already rebuilt for that key. | |
| offsetUnset($key) | \ArrayAccess::offsetUnset -- on a list (sequential integer keys, as produced by $bag[] = ...), the element is spliced out (closing the gap and reindexing), matching \unset() semantics on a plain … | |
| storeValue($key, $value) | \ArrayAccess::offsetSet -- a null $key appends ($bag[] = $value), like a plain PHP array. | |
| toArray() | Recursively convert to plain arrays. | |
| __construct($data) |
Properties2
content
nodeCache
- Type
- array
Methods20
add($key, $node)
DocNode.php:83Append a child node under $key.
clear()
tArray.php:25Empty the underlying content, keeping the object itself.
| returns |
compact()
DocNode.php:91Drop every key whose value is null, '' or [] -- keeps the generated json readable and small.
| returns | static |
count()
tArray.php:90\Countable::count
| returns | int |
defaults()
DocNode.php:36| returns | array | the keys every node of this kind always carries (so a renderer never has to test for them). |
Flatten($value)
staticDocNode.php:113get($key, $default)
DocNode.php:47Read a key, without the "undefined array key" notice $node['missing'] would raise (tArray::offsetGet returns by reference, so it cannot null-coalesce on its own).
getIterator()
tArray.php:97\IteratorAggregate::getIterator
| returns | Traversable |
isEmpty()
tArray.php:33| returns | true if the underlying content has no elements |
jsonSerialize()
DocNode.php:108| returns | mixed |
keys()
tArray.php:82| returns | array | the list of keys currently set |
loadArray($data)
tArray.php:71Load every entry of a plain array into the content, through offsetSet (so any offsetSet() override defined by the class using this trait, e.g. for validation or type coercion, is honored for every entry).
nodes($key, $class)
DocNode.php:58Read a key as a list of child nodes, rebuilding each one into $class if it is still a plain array (which is what it is right after json_decode).
offsetExists($key)
tArray.php:130\ArrayAccess::offsetExists
offsetGet($key)
tArray.php:115\ArrayAccess::offsetGet
offsetSet($key, $value)
DocNode.php:72Store a value, dropping whatever nodes had already rebuilt for that key.
offsetUnset($key)
tArray.php:107\ArrayAccess::offsetUnset -- on a list (sequential integer keys, as produced by $bag[] = ...), the element is spliced out (closing the gap and reindexing), matching \unset() semantics on a plain PHP list; on an associative array, the key is simply removed.
storeValue($key, $value)
tArray.php:122\ArrayAccess::offsetSet -- a null $key appends ($bag[] = $value), like a plain PHP array.
toArray()
DocNode.php:104Recursively convert to plain arrays. tArray::toArray only unwraps iArray values sitting *directly* under a key -- a documentation node keeps most of its children in plain lists (members, params, ...), so those have to be walked too or the result is still full of objects.
| returns | array |
__construct($data)
DocNode.php:30| $data = [] | array |