PHPackages                             zenify/doctrine-extensions-tree - 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. zenify/doctrine-extensions-tree

Abandoned → [nettrine/extensions](/?search=nettrine%2Fextensions)Library[Database &amp; ORM](/categories/database)

zenify/doctrine-extensions-tree
===============================

Implementation of Tree from DoctrineExtensions to Nette.

v4.2(9y ago)022.3k2[1 issues](https://github.com/deprecated-packages/DoctrineExtensionsTree/issues)MITPHPPHP ^7.0

Since Oct 21Pushed 9y ago3 watchersCompare

[ Source](https://github.com/deprecated-packages/DoctrineExtensionsTree)[ Packagist](https://packagist.org/packages/zenify/doctrine-extensions-tree)[ RSS](/packages/zenify-doctrine-extensions-tree/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (12)Used By (0)

DoctrineExtensions - Tree
=========================

[](#doctrineextensions---tree)

[![Build Status](https://camo.githubusercontent.com/8054ba2261e14cf71bf999a063dde38e4f751f971f0bc7648c6553a9eb3e6016/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5a656e6966792f446f637472696e65457874656e73696f6e73547265652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Zenify/DoctrineExtensionsTree)[![Quality Score](https://camo.githubusercontent.com/ed4a4f92f2001b7bc38e2d00a25d09c250ff9431b51e17cdd56794c4e2ccbbf4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f5a656e6966792f446f637472696e65457874656e73696f6e73547265652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Zenify/DoctrineExtensionsTree)[![Code Coverage](https://camo.githubusercontent.com/2cc26d27a1f8fd2cd995b73cc084e0daca060659c9dfa0f90ea8787548fb24e4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5a656e6966792f446f637472696e65457874656e73696f6e73547265652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Zenify/DoctrineExtensionsTree)[![Downloads](https://camo.githubusercontent.com/fb7b45fe2b2ba8ec90fd8e6e8f7b07fe1a091ecd88cf5d4cc35d4367c067da7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a656e6966792f646f637472696e652d657874656e73696f6e732d747265652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zenify/doctrine-extensions-tree)[![Latest stable](https://camo.githubusercontent.com/1b83015150bb9b8da5ddfe4fa104997f16d3fabb95b8e0b4c60088f2bee14ba7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a656e6966792f646f637472696e652d657874656e73696f6e732d747265652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zenify/doctrine-extensions-tree)

Implementation of [Tree from DoctrineExtensions](https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/tree.md) to Nette.

Install
-------

[](#install)

```
composer require zenify/doctrine-extensions-tree
```

Register extension:

```
# app/config/config.neon
extensions:
	- Zenify\DoctrineExtensionsTree\DI\TreeExtension
```

Usage
-----

[](#usage)

For entity implementation, follow [manual](https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/tree.md)

Very simple entity could look like this:

```
namespace App\Entities;

use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="App\Model\CategoryTree")
 * @Gedmo\Tree(type="materializedPath")
 */
class Category
{

	/**
	 * @ORM\Column(type="integer")
	 * @ORM\Id
	 * @ORM\GeneratedValue
	 */
	public $id;

	/**
	 * @Gedmo\TreePathSource
	 * @ORM\Column(type="string")
	 * @var string
	 */
	private $name;

	/**
	 * @Gedmo\TreeParent
	 * @ORM\ManyToOne(targetEntity="Category", cascade={"persist"})
	 * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=TRUE)
	 * @var Category
	 */
	private $parent;

	/**
 	 * @Gedmo\TreePath(separator="|")
	 * @ORM\Column(type="string", nullable=TRUE)
	 * @var string
	 */
	private $path;

	/**
	 * @param string $name
	 * @param Category $parent
	 */
	public function __construct($name, Category $parent = NULL)
	{
		$this->name = $name;
		$this->parent = $parent;
	}

	/**
	 * @return string
	 */
	public function getName()
	{
		return $this->name;
	}

	/**
	 * @return Category
	 */
	public function getParent()
	{
		return $this->parent;
	}

	/**
	 * @return string
	 */
	public function getPath()
	{
		return $this->path;
	}

}
```

And it's repository:

```
namespace App\Model;

use Gedmo\Tree\Entity\Repository\MaterializedPathRepository;

class CategoryTree extends MaterializedPathRepository
{

}
```

Testing
-------

[](#testing)

```
composer check-cs # see "scripts" section of composer.json for more details
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Rules are simple:

- new feature needs tests
- all tests must pass
- 1 feature per PR

We would be happy to merge your feature then!

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

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

Total

11

Last Release

3420d ago

Major Versions

v0.0.1 → v1.0.02014-12-12

v1.1.0 → v4.12016-12-28

PHP version history (4 changes)v0.0.1PHP &gt;=5.5

v1.0.2PHP &gt;=5.6

v1.0.3PHP &gt;=5.4

v1.1.0PHP ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/538058?v=4)[Milan Šulc](/maintainers/f3l1x)[@f3l1x](https://github.com/f3l1x)

![](https://www.gravatar.com/avatar/ac6d98091d07a41ebf65cf8496d73e14297ada4031f998d68a2ab30e6ef8a883?d=identicon)[enumag](/maintainers/enumag)

---

Top Contributors

[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zenify-doctrine-extensions-tree/health.svg)

```
[![Health](https://phpackages.com/badges/zenify-doctrine-extensions-tree/health.svg)](https://phpackages.com/packages/zenify-doctrine-extensions-tree)
```

###  Alternatives

[stof/doctrine-extensions-bundle

Integration of the gedmo/doctrine-extensions with Symfony

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

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[nettrine/orm

Doctrine ORM for Nette Framework

581.9M37](/packages/nettrine-orm)[nettrine/migrations

Doctrine Migrations for Nette Framework

411.7M17](/packages/nettrine-migrations)[nettrine/dbal

Doctrine DBAL for Nette Framework

322.6M19](/packages/nettrine-dbal)[nettrine/annotations

Doctrine Annotations for Nette Framework

193.0M7](/packages/nettrine-annotations)

PHPackages © 2026

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