Upgrade to 2.0
v7When upgrading to version 2.0, be aware of these breaking changes:
- Automatic Saving: Calling
$parent->append($node)and$parent->prepend($node)now automatically saves the$node. These methods return a boolean indicating whether the node was successfully saved. - Ancestors Retrieval: The
ancestorsOfmethod now returns only the ancestors, excluding the target node itself. - Ordering: Default order is no longer applied automatically. To ensure nodes are returned in tree-order, you must explicitly call
defaultOrder()on the query. - Root Node Management: A root node is no longer required. Consequently, the
NestedSet::createRootmethod has been removed. - Schema Changes:
NestedSet::columnsno longer automatically creates a foreign key for theparent_idcolumn.