PHPackages                             janisbiz/doctrine-nested-set - 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. [Database &amp; ORM](/categories/database)
4. /
5. janisbiz/doctrine-nested-set

ActiveLibrary[Database &amp; ORM](/categories/database)

janisbiz/doctrine-nested-set
============================

Doctrine extension to support nested set model

v3.1.4(7y ago)53322MITPHPPHP &gt;=7.1CI failing

Since Aug 31Pushed 6y ago2 watchersCompare

[ Source](https://github.com/janisbiz/doctrine-nested-set)[ Packagist](https://packagist.org/packages/janisbiz/doctrine-nested-set)[ RSS](/packages/janisbiz-doctrine-nested-set/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (11)Versions (27)Used By (0)

Doctrine nested set
===================

[](#doctrine-nested-set)

[![Latest Stable Version](https://camo.githubusercontent.com/1062ed4a3abe721728ddfe774fd3ccb34a03f8db85b13f6bb991611b539d3694/68747470733a2f2f706f7365722e707567782e6f72672f6a616e697362697a2f646f637472696e652d6e65737465642d7365742f762f737461626c65)](https://packagist.org/packages/janisbiz/doctrine-nested-set)[![Build Status](https://camo.githubusercontent.com/db01c12e562f586b0699dfd04798271d7338fcbe4f8f5f4ed13636e29fd9505e/68747470733a2f2f7472617669732d63692e636f6d2f6a616e697362697a2f646f637472696e652d6e65737465642d7365742e7376673f6272616e63683d706870372e312e78)](https://travis-ci.com/janisbiz/doctrine-nested-set)[![Total Downloads](https://camo.githubusercontent.com/74772e3a98646a9d9e7774f859b55f13e049fe2d0f9bdf88ac9a23356b2a022e/68747470733a2f2f706f7365722e707567782e6f72672f6a616e697362697a2f646f637472696e652d6e65737465642d7365742f646f776e6c6f616473)](https://packagist.org/packages/janisbiz/doctrine-nested-set)[![Deps](https://camo.githubusercontent.com/af5f885b1dd64b141209e1c1c9c7149368cc56c5bd7922b1a17e367c89dfe197/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e64656e636965732d7570253230746f253230646174652d627269676874677265656e2e737667)](https://camo.githubusercontent.com/af5f885b1dd64b141209e1c1c9c7149368cc56c5bd7922b1a17e367c89dfe197/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646570656e64656e636965732d7570253230746f253230646174652d627269676874677265656e2e737667)

Adds a functionality for Doctrine, so it can be used by nested set model defined [here](https://en.wikipedia.org/wiki/Nested_set_model).

Installing
----------

[](#installing)

`composer require janisbiz/doctrine-nested-set`

Getting started
---------------

[](#getting-started)

These instructions will help you set up this doctrine extension, so you can use it. As well, there are provided instructions to run integration tests for the extension.

Using extension
---------------

[](#using-extension)

To use extension:

- your entity class should implement [NestedSetEntityInterface](src/Entity/NestedSetEntityInterface.php)
- your repository class should extend [NestedSetEntityRepository](src/Repository/NestedSetEntityRepository.php)

Afterwards you can use helper functions from [NestedSetEntityRepository](src/Repository/NestedSetEntityRepository.php), which are sufficient for full operations on nested set tree model.

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

[](#running-tests)

There are two ways to run tests:

1. By using docker containers:
    - Copy `.env.dist` to `.env` and adjust defined values for your needs
    - Execute `docker-compose up -d --build`
    - Execute `docker-compose exec php composer install`
    - Execute `docker-compose exec php vendor/bin/behat`
2. By using your local php and mysql database environment:
    - Ensure, that your php version is `7.1.x`
    - Install `pdo_mysql` extension for php
    - Adjust database connection in [configuration file](src/Tests/Features/Bootstrap/Resources/config/doctrine.yaml)
    - Execute `composer install`
    - Execute `vendor/bin/behat`

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~4 days

Recently: every ~14 days

Total

23

Last Release

2713d ago

Major Versions

v2.1.0 → v3.1.22018-09-02

v1.1.1 → v2.1.12018-09-02

v2.1.2 → v3.1.32018-09-03

v1.1.2 → v3.0.32018-10-11

v2.1.4 → v3.1.42018-12-07

PHP version history (6 changes)v1.0.0PHP &gt;=5.3.2

v2.0.0PHP &gt;=7.0

v3.0.0PHP &gt;=7.1

v1.1.0PHP 5.\*

v2.1.0PHP 7.0.\*

v3.0.4PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f85e3280bdaa81572855b1f07dd928cc6d4c1b5397fd975fb3693dc773462f7?d=identicon)[janisbiz](/maintainers/janisbiz)

---

Top Contributors

[![janisbiz](https://avatars.githubusercontent.com/u/19405629?v=4)](https://github.com/janisbiz "janisbiz (7 commits)")

---

Tags

treebehaviorsextensionsnestedsetdoctrine2janisbiz

###  Code Quality

TestsBehat

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/janisbiz-doctrine-nested-set/health.svg)

```
[![Health](https://phpackages.com/badges/janisbiz-doctrine-nested-set/health.svg)](https://phpackages.com/packages/janisbiz-doctrine-nested-set)
```

###  Alternatives

[stof/doctrine-extensions-bundle

Integration of the gedmo/doctrine-extensions with Symfony

1.9k85.3M381](/packages/stof-doctrine-extensions-bundle)[gedmo/doctrine-extensions

Doctrine behavioral extensions

4.1k118.8M366](/packages/gedmo-doctrine-extensions)[knplabs/doctrine-behaviors

Doctrine Behavior Traits

92212.7M64](/packages/knplabs-doctrine-behaviors)

PHPackages © 2026

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