[Dbix-class] RFC: DBIx::Tree::NestedSet

Florian Ragwitz rafl at debian.org
Mon Jul 28 02:27:44 BST 2008


On Sun, Jul 27, 2008 at 07:09:24PM -0500, Wade.Stuart at fallon.com wrote:
> It looks like it is missing some of the nested set functionality that I
> would use:

> is_leaf -- is the node childless?
> is_root -- is the node root?

Those methods already exist, as well as is_branch.

> path_to_node -- show the breadcrumb to node

The parents method gives an ordered list of parent nodes. Isn't that
pretty much the same?

> delete -- deletes the node and all related children
> delete_node -- deletes a node and takes parameters as whether to (if they
> exist) shift children to parent, make nodes on current level or shift to
> peer node.
> chroot -- set the root as a member node
> node_depth -- what is the depth of the node (depth_of_subrtee 0, x)
> depth_of_subtree -- given a node what is the depthmap of children
> immidiate_children -- only respond with immediate children of the node
> (children_maxdepth 1)
> children_maxdepth -- search for children to a given max depth

I didn't get around to implement the other methods yet.

> I have sql for most of these (mysql sorry).  is there any interest to
> add these?

That would be helpful.


-- 
BOFH excuse #81:
Please excuse me, I have to circuit an AC line through my head to get
this database working.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080728/30f9e5cb/attachment.pgp


More information about the DBIx-Class mailing list