2017 © Pedro Peláez
 

library tree

PHP 5.6+ Tree structure management

image

sweelix/tree

PHP 5.6+ Tree structure management

  • Tuesday, March 22, 2016
  • by pgaultier
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Sweelix Node management

Sweelix node management is an implementation of Rational numbers to key nested sets by Dan Hazel (http://arxiv.org/abs/0806.3115)., (*1)

Latest Stable Version Build Status, (*2)

Installation

If you use Packagist for installing packages, then you can update your composer.json like this :, (*3)

``` json { "require": { "sweelix/tree": "*" } }, (*4)


Howto use it ------------ Create a Node class and attach the NodeTrait to it. You can look at the class ```Node```. ``` php use sweelix\tree\NodeTrait; class MyNode { use NodeTrait; }

Now you can create a node :, (*5)

``` php $node = new MyNode(); $node->setPath('1.2.1');, (*6)

$leftBorder = $node->getLeft();, (*7)

$rightBorder = $node->getRight();, (*8)

$treeInfo = $node->getMatrix()->toArray();, (*9)

// insert your node in DB using leftBorder and rightBorder // do not forget to also store the tree info, (*10)


Now you can search the node in your DB using regular nested set methods : ```sql # find all the children select * from nodes where left > :nodeLeft and right < :nodeRight order by nodeLeft; # find all the parents select * from nodes where left < :nodeLeft and right > :nodeRight order by nodeRight;

Contributing

All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code., (*11)

Fork the project, create a feature branch , and send us a pull request., (*12)

The Versions

22/03 2016

dev-devel

dev-devel

PHP 5.6+ Tree structure management

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

The Development Requires

by Philippe Gaultier

tree nested

22/03 2016

dev-master

9999999-dev

PHP 5.6+ Tree structure management

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

The Development Requires

by Philippe Gaultier

tree nested

22/03 2016

1.0.2

1.0.2.0

PHP 5.6+ Tree structure management

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

The Development Requires

by Philippe Gaultier

tree nested

21/03 2016

1.0.1

1.0.1.0

PHP 5.6+ Tree structure management

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6.0

 

The Development Requires

by Philippe Gaultier

tree nested

21/03 2016

1.0.0

1.0.0.0

PHP 5.4+ Tree structure management

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4.0

 

The Development Requires

by Philippe Gaultier

tree nested