Giter VIP home page Giter VIP logo

dbtree's Introduction

DbTree - Nested Sets

This class can be used to manipulate nested sets of database table records as an hierarchical tree.

It can initialize a tree, insert nodes in specific positions of the tree, retrieve node and it's parent records, change nodes position and delete nodes..

This source file is part of the SESMIK CMS.

##Methods:

  • GetNode - Receive all data for node with number $nodeId.
  • GetParent - Receive data of closest parent for node with number $nodeId.
  • Insert - Add new child element to node with number $parentId.
  • InsertNear - Add a new element into the tree near node with number $nodeId.
  • MoveAll - Assigns another parent ($parentId) to a node ($nodeId) with all its children.
  • ChangePosition - Change position of nodes. Nodes have to have same parent and same level of nesting.
  • ChangePositionAll - Swapping nodes with it's children. Nodes have to have same parent and same level of nesting. $nodeId1 can be placed "before" or "after" $nodeId2.
  • Delete - Deletes element with number $nodeId from the tree without deleting it's children. All it's children will move up one level.
  • DeleteAll - Deletes element with number $nodeId from the tree and all it children.
  • Full - Returns all elements of the tree sorted by "left".
  • Branch - Returns all elements of a branch starting from an element with number $nodeId.
  • Parents - Returns all parents of element with number $nodeId.
  • Ajar - Returns a slightly opened tree from an element with number $nodeId.
  • SortChildren - Sort children in a tree for $orderField in alphabetical order.
  • MakeUlList - Makes UL/LI html from nested sets tree with links (if needed). UL id named as table_name + _tree.

History

  • v4.4 - MakeUlList modified
  • v4.3 - Added new method MakeUlList
  • v4.2 - added fully functional demo samples
  • v4.1 - added new method SortChildren

russian dicumentation http://www.sesmikcms.ru/pages/read/biblioteka-dlja-raboty-s-derevjami-nested-sets/

##Author Kuzma Feskov [email protected] ##Copyright © 2015, Kuzma Feskov

dbtree's People

Contributors

kvf77 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.