Closure Table v0.1.1 CTE.Adapter behaviour View Source
Specification of the Closure Table implementation.
Most of the functions implementing the CTE.Adapter
behavior, will accept the following options:
:limit
, to limit the total number of nodes returned, when finding the ancestors or the descendants for nodes:itself
, accepting a boolean value. Whentrue
, the node used for finding its neighbors are returned as part of the results. Default: true:nodes
, accepting a boolean value. Whentrue
, the results are containing additional information about the nodes. Default: false
Link to this section Summary
Callbacks
Retrieve the ancestors of a node
Delete a leaf or a subtree. When limit: 1, the default value, then delete only the leafs, else the entire subtree
Retrieve the descendants of a node
Insert a node under an existing ancestor
Move a subtree from one location to another.
Calculate and return a "tree" structure containing the paths and the nodes under the given leaf/node
Link to this section Types
Link to this section Callbacks
Retrieve the ancestors of a node
Delete a leaf or a subtree. When limit: 1, the default value, then delete only the leafs, else the entire subtree
Retrieve the descendants of a node
Insert a node under an existing ancestor
Move a subtree from one location to another.
First, the subtree and its descendants are disconnected from its ancestors. And second, the subtree is inserted under the new parent (ancestor) and the subtree, including its descendants, is declared as descendants of all the new ancestors.
Calculate and return a "tree" structure containing the paths and the nodes under the given leaf/node