LEAP™ is a content editor’s dream (CMS), a designer’s best option, and the perfect framework for site development.
LEAP™ is simpleLEAPLEAP™ is secureLEAPLEAP™ is SEO-centric

xs_cat

This type is a collection of related methods that manage a hierarchal nested database set, also known as MPTT (Modified Preorder Tree Traversal).

Member methods:

addSibling
Adds an entry AFTER specified item, at the same depth

addChild
Adds a child to the specified item.
Usually employed when there is no existing child.

deleteNode
Deletes the node and all it's child nodes.

moveNode
Moves the node and all it's child nodes in the specified direction.

fullCatSQL
Returns the SQL required to extract the full tree.

subTreeSQL
Returns the SQL required to extract the tree branching from a specified node.

showPathSQL
Returns the SQL that will extract the linear path from the root to the node.

getParent
Returns a map with the parent id and name

Sample Usage:

xs_cat->(addSibling(-cattable='nestedset',-txt='Hello World',-id=10))
xs_cat->(addChild(-cattable='nestedset',-txt='Hello World',-id=10))
xs_cat->(deleteNode(-cattable='nestedset',-id=10))
xs_cat->(moveNode(-cattable='nestedset',-id=10)) 
xs_cat->(fullCatSQL(
      -cattable='nestedset',
      -xtraReturn=',column1, column2',
      -xtraWhere='SQL statement here')
) 
xs_cat->(subTreeSQL(
      -cattable='nestedset',
      -depth=2,
      -relative=true,
      -xtraReturn=',column1, column2',
      -xtraWhere='SQL statement here')
)
xs_cat->(showPathSQL(
      -cattable='nestedset',
      -xtraReturn=',column1, column2',
      -xtraWhere='SQL statement here')
)

© Copyright LEAP™ 2017 | Privacy Policy | Design by Treefrog Inc.