Download the PHP package stefano/stefano-tree without Composer
On this page you can find all versions of the php package stefano/stefano-tree. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download stefano/stefano-tree
More information about stefano/stefano-tree
Files in stefano/stefano-tree
Download stefano/stefano-tree
More information about stefano/stefano-tree
Files in stefano/stefano-tree
Vendor stefano
Package stefano-tree
Short Description Nested Set(MPTT) implementation for PHP
License BSD-3-Clause
Homepage https://github.com/bartko-s/stefano-tree
Package stefano-tree
Short Description Nested Set(MPTT) implementation for PHP
License BSD-3-Clause
Homepage https://github.com/bartko-s/stefano-tree
Please rate this library. Is it a good library?
Informations about the package stefano-tree
Tree
Nested Set implementation for PHP.
Features
- NestedSet(MPTT - Modified Pre-order Tree Traversal)
- Support scopes (multiple independent tree in one db table)
- Rebuild broken tree
- Tested with MySQL/MariaDB and PostgreSQL but should work with any database vendor which support transaction
- Supported PDO, Zend Framework 1, Laminas Db, Doctrine 2 DBAL and Doctrine 3 DBAL. It is easy to implement support for any framework
- Support nested transaction
- PHP 7 and PHP 8 support
Dependencies
- This library has no external dependencies. Can work with pure PHP.
Installation
Run following command in terminal
Create Tree Adapter
key | type | required | default value | note |
---|---|---|---|---|
tableName | string | yes | ||
idColumnName | string | yes | ||
leftColumnName | string | no | lft | |
rightColumnName | string | no | rgt | |
levelColumnName | string | no | level | |
parentIdColumnName | string | no | parent_id | |
sequenceName | string | see note | Required for PostgreSQL | |
scopeColumnName | string | see note | If empty scope support is disabled | |
dbSelectBuilder | callable | no | see Join table example below |
- You can join table.
API
Creating nodes
-
Create root node
- Create new node. You can create new node at 4 different locations.
Update Node
Move node
- You can move node at 4 different locations.
Delete node or branch
Getting nodes
-
Get descendants
- Get Ancestors
Validation and Rebuild broken tree
-
Check if tree is valid
- Rebuild broken tree
Contributing
Any contributions are welcome. If you find any issue don't hesitate to open a new issue or send a pull request.
All versions of stefano-tree with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1.0
The package stefano/stefano-tree contains the following files
Loading the files please wait ....