PHPackages                             harp-orm/nested - 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. harp-orm/nested

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

harp-orm/nested
===============

Adjacency List (parentId column) for Harp ORM

0.3.0(11y ago)119BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jun 26Pushed 11y ago2 watchersCompare

[ Source](https://github.com/harp-orm/nested)[ Packagist](https://packagist.org/packages/harp-orm/nested)[ RSS](/packages/harp-orm-nested/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Nested
======

[](#nested)

[![Build Status](https://camo.githubusercontent.com/3d5880bc2898a38e1df20a9786b98f0419cc1cde58f05914ac94e0602bdc624c/68747470733a2f2f7472617669732d63692e6f72672f686172702d6f726d2f6e65737465642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/harp-orm/nested)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b4644644c34bfb15c644e3a9f2bad4b6ba33ade5683ad1bbd7fbb8fc2d40abcc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f686172702d6f726d2f6e65737465642f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/harp-orm/nested/)[![Code Coverage](https://camo.githubusercontent.com/b22a11846860c2eb17be02c097f1e240ce9b387702a7d7bc341db953f5502100/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f686172702d6f726d2f6e65737465642f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/harp-orm/nested/)[![Latest Stable Version](https://camo.githubusercontent.com/b0f21338d86e5e03f487fd8a3eb5669568909d6f86777f7b08ce013a944c8ae5/68747470733a2f2f706f7365722e707567782e6f72672f686172702d6f726d2f6e65737465642f762f737461626c652e706e67)](https://packagist.org/packages/harp-orm/nested)

Adjacency List (parentId column) for Harp ORM

Usage
-----

[](#usage)

Add the Trait to your Model

```
// Model Class
use Harp\Nested\NestedTrait;

class Category extends AbstractModel
{
    use NestedTrait;

    public static function initialize($config)
    {
        NestedTrait::initialize($config);

        // Other initializations
        // ...
    }
}
```

**Database Table:**

```
┌─────────────────────────┐
│ Table: Category         │
├─────────────┬───────────┤
│ id          │ ingeter   │
│ name        │ string    │
│ parentId*   │ integer   │
└─────────────┴───────────┘
* Required fields

```

Methods
-------

[](#methods)

It will add "parent" and "children" Rels to the repo. The model will get the convenience methods:

MethodDescription**getParent**()Return the parent model**setParent**(AbstractModel $parent)Set the parent model**getChildren**()Get immidiate children. Returns a Models object**isRoot**()Boolean check if it is root (has parent) or not**getParents**()Return all the parents, including root. Models objectLicense
-------

[](#license)

Copyright (c) 2014, Clippings Ltd. Developed by Ivan Kerin

Under BSD-3-Clause license, read LICENSE file.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

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

Total

3

Last Release

4323d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/506129?v=4)[Harry Dobrev](/maintainers/hkdobrev)[@hkdobrev](https://github.com/hkdobrev)

---

Top Contributors

[![ivank](https://avatars.githubusercontent.com/u/4976?v=4)](https://github.com/ivank "ivank (21 commits)")

### Embed Badge

![Health badge](/badges/harp-orm-nested/health.svg)

```
[![Health](https://phpackages.com/badges/harp-orm-nested/health.svg)](https://phpackages.com/packages/harp-orm-nested)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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