PHPackages                             pvsaintpe/ltree-bundle - 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. pvsaintpe/ltree-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

pvsaintpe/ltree-bundle
======================

Symfony 4 bundle for postgresql ltee extension

2.0.1(5y ago)101946[2 issues](https://github.com/pvsaintpe/ltree-bundle/issues)MITPHPPHP ^7.4|^8.0CI failing

Since Apr 25Pushed 5y ago2 watchersCompare

[ Source](https://github.com/pvsaintpe/ltree-bundle)[ Packagist](https://packagist.org/packages/pvsaintpe/ltree-bundle)[ Docs](https://github.com/pvsaintpe/ltree-bundle)[ RSS](/packages/pvsaintpe-ltree-bundle/feed)WikiDiscussions release Synced 3d ago

READMEChangelog (9)Dependencies (2)Versions (11)Used By (0)

ltree-bundle
============

[](#ltree-bundle)

Installation:
-------------

[](#installation)

```
composer require pvsaintpe/ltree-bundle

```

Using
-----

[](#using)

1. Create Entity class:

```
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Entity;
use LTree\Annotation\LTreeChilds;
use LTree\Annotation\LTreeEntity;
use LTree\Annotation\LTreeParent;
use LTree\Annotation\LTreePath;
use LTree\Repository\LTreeEntityInterface;

/**
 * Class TestEntity
 * @package LTree\Entity
 *
 * @Entity(repositoryClass="LTree\Entity\TestRepository")
 * @LTreeEntity()
 */
class TestEntity implements LTreeEntityInterface
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue(strategy="AUTO")
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @LTreePath()
     * @ORM\Column(type="ltree")
     */
    private $path = null;

    /**
     * @LTreeParent()
     * @ORM\ManyToOne(targetEntity="TestEntity", inversedBy="children")
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
     */
    private $parent;

    /**
     * @LTreeChilds()
     * @ORM\OneToMany(targetEntity="TestEntity", mappedBy="parent", cascade={"all"}, orphanRemoval=true)
     * @ORM\JoinColumn(onDelete="CASCADE")
     */
    private $children;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->children = new ArrayCollection();
    }
}
```

2. Create Repository class:

```
use Doctrine\ORM\EntityManagerInterface;
use LTree\Repository\LTreeEntityRepository;

/**
 * Class TestRepository
 *
 * @method TestEntity|null find($id, $lockMode = null, $lockVersion = null)
 * @method TestEntity|null findOneBy(array $criteria, array $orderBy = null)
 * @method TestEntity[]    findAll()
 * @method TestEntity[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 *
 * @package LTree\Entity
 */
class TestRepository extends LTreeEntityRepository
{
    /**
     * TestRepository constructor.
     * @param EntityManagerInterface $registry
     */
    public function __construct(EntityManagerInterface $registry)
    {
        parent::__construct($registry, $registry->getClassMetadata(TestEntity::class));
    }
}
```

3. Create Extension via migration

```
    public function up(Schema $schema) : void
    {
        $this->addSql('CREATE IF NOT EXISTS EXTENSION ltree');
    }
    ...
```

4. Configure Doctrine Type via config (packages/doctrine.yaml):

```
doctrine:
    dbal:
        url: '%env(resolve:DATABASE_URL)%'
        types:
            ltree:  LTree\Types\LTreeType
```

5. Configure Bundle via config (bundles.php):

```
LTree\LTreeExtensionBundle::class => ['all' => true],
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~84 days

Recently: every ~169 days

Total

9

Last Release

1898d ago

Major Versions

1.5.0 → 2.0.02021-02-27

PHP version history (3 changes)1.0.0PHP &gt;=7.3

1.0.1PHP ^7.1.3

2.0.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16900171?v=4)[Corben Dallas](/maintainers/pvsaintpe)[@pvsaintpe](https://github.com/pvsaintpe)

---

Top Contributors

[![pvsaintpe](https://avatars.githubusercontent.com/u/16900171?v=4)](https://github.com/pvsaintpe "pvsaintpe (4 commits)")[![anomality](https://avatars.githubusercontent.com/u/22884125?v=4)](https://github.com/anomality "anomality (1 commits)")

---

Tags

phpsymfonynestedpostgresqlphp8symfony4symfony5ltree

### Embed Badge

![Health badge](/badges/pvsaintpe-ltree-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/pvsaintpe-ltree-bundle/health.svg)](https://phpackages.com/packages/pvsaintpe-ltree-bundle)
```

###  Alternatives

[umbrellio/laravel-ltree

Extension LTree (Postgres) for Laravel

34111.6k](/packages/umbrellio-laravel-ltree)[php-tmdb/symfony

Symfony Bundle for TMDB (The Movie Database) API. Provides easy access to the php-tmdb/api library.

3649.7k](/packages/php-tmdb-symfony)[goodwix/doctrine-json-odm

JSON Object-Document Mapping bundle for Symfony and Doctrine

2226.0k](/packages/goodwix-doctrine-json-odm)

PHPackages © 2026

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