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 trees in one db table)
- Rebuild broken tree
- Tested with MySQL/MariaDB and PostgreSQL but should work with any database vendor which supports transactions
- Supported PDO, Laminas Db, Doctrine DBAL 4. It is easy to implement support for any framework
- Support nested transactions
- PHP 8.2+ support (tested on PHP 8.2 – 8.5)
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 | |
| 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 a node
-
Get descendants
- Get ancestors
Validation and Rebuild broken tree
-
Check if tree is valid. Returns false when the tree is broken;
- 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
>=8.2.0
The package stefano/stefano-tree contains the following files
Loading the files please wait ...
