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

ActiveLibrary

harp-orm/materialized-path
==========================

Materialized path nesting for Harp ORM models

0.3.1(11y ago)11842BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jun 26Pushed 11y ago2 watchersCompare

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

READMEChangelog (5)Dependencies (1)Versions (6)Used By (2)

Materialized Path
=================

[](#materialized-path)

[![Build Status](https://camo.githubusercontent.com/c9306c7395458e5bae283e9394186383b2984eaa916ccc09ed80b9feb737d4f2/68747470733a2f2f7472617669732d63692e6f72672f686172702d6f726d2f6d6174657269616c697a65642d706174682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/harp-orm/materialized-path)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4e33636c0c4a597652f99fb0989202d7f2679d2e067a8b09c2eb606dfe4ecf00/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f686172702d6f726d2f6d6174657269616c697a65642d706174682f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/harp-orm/materialized-path/)[![Code Coverage](https://camo.githubusercontent.com/b3c75e9fb6a12b11efbe00623af45ea8996605c85c236db9583f66e7d0f62e70/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f686172702d6f726d2f6d6174657269616c697a65642d706174682f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/harp-orm/materialized-path/)[![Latest Stable Version](https://camo.githubusercontent.com/4d1aaf5fc99dc40a5f6cf56371c244609d548ff055ad782bd378efbaedc0284e/68747470733a2f2f706f7365722e707567782e6f72672f686172702d6f726d2f6d6174657269616c697a65642d706174682f762f737461626c652e737667)](https://packagist.org/packages/harp-orm/materialized-path)

Materialized path nesting for Harp ORM models.

What is Materialized path? Here's a great explanation: This package does not implement the most advanced implementation, but it works quite well as is.

Usage
-----

[](#usage)

Add the Trait to your Model

```
use Harp\Harp\AbstractModel;
use Harp\MP\MaterializedPathTrait;

class Category extends AbstractModel
{
    public static function initialize($config)
    {
        MaterializedPathTrait::initialize($config);

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

**Database Table:**

```
┌─────────────────────────┐
│ Table: Category         │
├─────────────┬───────────┤
│ id          │ ingeter   │
│ name        │ string    │
│ parentId*   │ integer   │
│ path*       │ string    │
└─────────────┴───────────┘
* 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 immidiate parent model**setParent**(AbstractModel $parent)Set the immidiate parent model, after save the changes are propogated to all the children**getChildren**()Get immidiate children. Returns a Models object**isRoot**()Boolean check if it is root (has parent) or not**getDescendants**()Returns all the children and the children's children. Models object**getAnsestors**()Return all the parents, including root. Models object**isDescendantOf**(AbstractModel $parent)Chech if a model is descendant**isAnsestorOf**(AbstractModel $parent)Chech if model is ansestorLicense
-------

[](#license)

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

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

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

Total

5

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 (29 commits)")

### Embed Badge

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

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

PHPackages © 2026

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