Tree
Tree copied to clipboard
PHP library for handling tree structures based on parent IDs, e.g. a self-joined database table
Since version 2.0, the method `Node::getAncestorsGeneric` does not return the last ancestor of the set of nodes. In version 1.5.3, the method did not exist and the original method looked...
Is it possible to duplicate child of a node with all its subchildren structure? Give example please.
**\BlueM\Tree::getNodeById()** returns non-existent nodes: ```php $data = []; $sut = new BlueM\Tree($data); // #1: returns a "\BlueM\Tree\Node" (incorrect) var_dump($sut->getNodeById(0)); // #2: throws InvalidArgumentException (correct) var_dump($sut->getNodeById(1)); ``` **Expected behavior:** when an...
Hello, I need to check when I already visited a node when traversing through a tree. In the array of arrays that I used to create the tree I added...
When encountering a build issue, I want to log an error instead of throwing an exception because the rest of the tree is still usable. The default handler checks if...
I think the project will benefit from using constants instead of magic strings when declaring options. This will allow flexibility when renaming options internally in the future, as well as...
Node::Get why throw an exeption and not null? I've the problem there are parents with an propertie or the propertie is unset. If I initialize it with null and call...
https://github.com/BlueM/Tree/blob/ded69515db52cb95afd9655d632bfffc6494641c/src/Tree/Node.php#L40C9-L40C76