PHPackages                             alex-kalanis/nested-tree-nette - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alex-kalanis/nested-tree-nette

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alex-kalanis/nested-tree-nette
==============================

PHP Library to process nested tree structures - for Nette

v2.2.0(4mo ago)040MITPHPPHP &gt;=8.1.0CI passing

Since Apr 4Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/alex-kalanis/nested-tree-nette)[ Packagist](https://packagist.org/packages/alex-kalanis/nested-tree-nette)[ Docs](https://www.github.com/alex-kalanis/nested-tree-nette)[ RSS](/packages/alex-kalanis-nested-tree-nette/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (10)Versions (7)Used By (0)

Nested Tree - for Nette database
================================

[](#nested-tree---for-nette-database)

[![Build Status](https://github.com/alex-kalanis/nested-tree-nette/actions/workflows/code_checks.yml/badge.svg)](https://github.com/alex-kalanis/nested-tree-nette/actions/workflows/code_checks.yml/badge.svg)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b39d7021461bd573ef2a90d4f687f8302c411a0e035c740c42639dc2ac289a54/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65782d6b616c616e69732f6e65737465642d747265652d6e657474652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alex-kalanis/nested-tree-nette/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/e266297770e4b5200395ff4356318c9fbdb52ea3ef7daa0e1b702efe729e1efe/68747470733a2f2f706f7365722e707567782e6f72672f616c65782d6b616c616e69732f6e65737465642d747265652d6e657474652f762f737461626c652e7376673f763d31)](https://packagist.org/packages/alex-kalanis/nested-tree-nette)[![Minimum PHP Version](https://camo.githubusercontent.com/183804d09fec16ca7b6209b007250b7d8db1b915042feb093a9f20e6e1f25359/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e312d3838393242462e737667)](https://php.net/)[![Downloads](https://camo.githubusercontent.com/bdedf0e9b978d3914e896eef15099b9774003f0bf4acebff9939c67117c375df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c65782d6b616c616e69732f6e65737465642d747265652d6e657474652e7376673f7631)](https://packagist.org/packages/alex-kalanis/nested-tree-nette)[![License](https://camo.githubusercontent.com/5acf7181f27848474797e80fce9bdd78a2cdff535e85dc2fb17788f71965beab/68747470733a2f2f706f7365722e707567782e6f72672f616c65782d6b616c616e69732f6e65737465642d747265652d6e657474652f6c6963656e73652e7376673f763d31)](https://packagist.org/packages/alex-kalanis/nested-tree-nette)[![Code Coverage](https://camo.githubusercontent.com/9baa411822d700e7bd9de2af0b1d2e21607394c20c889acb8c3f85441e33357d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65782d6b616c616e69732f6e65737465642d747265652d6e657474652f6261646765732f636f7665726167652e706e673f623d6d617374657226763d31)](https://scrutinizer-ci.com/g/alex-kalanis/nested-tree-nette/?branch=master)

Library to work with Nested tree set. Adapter for [Nette](https://nette.org/) and its database connection. Extension of [Nested tree](https://github.com/alex-kalanis/nested-tree) package.

About
-----

[](#about)

This is connection between Nested tree package and Nette framework. It exists due differences in accessing DB underneath, because Nette has own Database package and layer and not raw PDO.

Requirements
------------

[](#requirements)

- PHP version 8.1 or higher
- Nette database 3.2

Basic usage
-----------

[](#basic-usage)

Basic usage is about to same as `Nested Tree` package. The only difference is in datasource.

```
class MyNodes extends \kalanis\nested_tree\Support\Node
{
    public ?string $my_column = null;
}

class MyTable extends \kalanis\nested_tree\Support\TableSettings
{
    public string $tableName = 'my_menu';
}

$myNodes = new MyNodes();
$myTable = new MyTable();

// this is usually set via DI
$actions = new \kalanis\nested_tree\Actions(
    new \kalanis\nested_tree\NestedSet(
        new \kalanis\nested_tree_nette\Sources\Nette\MySql(
            $netteExplorer,
            $myNodes,
            $myTable,
        ),
        $myNodes,
        $myTable,
    ),
);

// now work:

// repair the whole structure
$actions->fixStructure();

// move node in row
$actions->movePosition(25, 3);

// change parent node for the one chosen
$actions->changeParent(13, 7);
```

DB structure
------------

[](#db-structure)

Basic usage is about to same as `Nested Tree` package.

Running tests
-------------

[](#running-tests)

The package contains tests written in [Nette Tester](https://tester.nette.org/).

- `tester` - runs all tests

Caveats
-------

[](#caveats)

As said in `Nested Tree` package, you must choose if you go with MariaDB or MySQL, because default implementation uses function [ANY\_VALUE()](https://jira.mariadb.org/browse/MDEV-10426) to go around the problem with non-standard `GROUP_BY` implementation. So you may either use MySQL 5.7+ or disable `ONLY_FULL_GROUP_BY` directive in MariaDB. Or write custom query source which itself will go around this particular problem.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance82

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~55 days

Recently: every ~68 days

Total

6

Last Release

123d ago

Major Versions

v1.0.1 → v2.0.02025-12-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/499b0a541b787cdb31412f578c7b94c9790bcbee7de12c65b6101c6ce45ef6f0?d=identicon)[alex-kalanis](/maintainers/alex-kalanis)

---

Top Contributors

[![alex-kalanis](https://avatars.githubusercontent.com/u/59184183?v=4)](https://github.com/alex-kalanis "alex-kalanis (16 commits)")

---

Tags

phpnettenestedtreemenu

###  Code Quality

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alex-kalanis-nested-tree-nette/health.svg)

```
[![Health](https://phpackages.com/badges/alex-kalanis-nested-tree-nette/health.svg)](https://phpackages.com/packages/alex-kalanis-nested-tree-nette)
```

###  Alternatives

[loophp/phptree

An implementation of tree data structure

981.8M2](/packages/loophp-phptree)[kartik-v/yii2-tree-manager

An enhanced tree management module with tree node selection and manipulation using nested sets.

156529.0k15](/packages/kartik-v-yii2-tree-manager)[contributte/menu-control

Menu control for Nette framework

29108.6k1](/packages/contributte-menu-control)[gilek/yii2-gtreetable

yii2-gtreetable is an extension of Yii 2 Framework, which is wrapper for bootstrap-gtreetable plug-in, on the other hand it provides functionality which allows to save the nodes states into database.

4111.8k](/packages/gilek-yii2-gtreetable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
