PHPackages                             aidask/yii-closure-table-behavior - 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. aidask/yii-closure-table-behavior

ActiveYii-extension[Database &amp; ORM](/categories/database)

aidask/yii-closure-table-behavior
=================================

ActiveRecord model behavior that allows to work with tree data.

v1.2.0(11y ago)171784BSD-3-ClausePHPPHP &gt;=5.1.0

Since Jul 13Pushed 11y ago2 watchersCompare

[ Source](https://github.com/AidasK/yii-closure-table-behavior)[ Packagist](https://packagist.org/packages/aidask/yii-closure-table-behavior)[ Docs](https://github.com/AidasK/yii-closure-table-behavior)[ RSS](/packages/aidask-yii-closure-table-behavior/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Yii Closure Table behavior
==========================

[](#yii-closure-table-behavior)

Extension allows managing trees stored in database.

Configuration
-------------

[](#configuration)

Add behavior to model as follows:

```
public function behaviors()
{
    return array(
        'closureTableBehavior'=>array(
  			'class'=>'ext.ClosureTableBehavior',
			'closureTableName'=>'table_name',
		)
    );
}
```

Examples
--------

[](#examples)

Model configuration: /tests/models/Folder.php

Schema example: /tests/schema/db.sql

Behavior usage: /tests/unit/ClosureTableBehaviorTest.php

Contribution
------------

[](#contribution)

Your participation to Yii Closure Table behavior development is very welcome!

To ensure consistency throughout the source code, keep these rules in mind as you are working:

- All features or bug fixes must be tested by one or more specs.
- Your code should follow [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding style guide

Literature:
-----------

[](#literature)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

4320d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84dca3b0b2f04e0fe2edea306f6a158ade8ef4636eddb2105d1709b76b8af41e?d=identicon)[AidasK](/maintainers/AidasK)

---

Top Contributors

[![AidasK](https://avatars.githubusercontent.com/u/2088484?v=4)](https://github.com/AidasK "AidasK (30 commits)")

---

Tags

treeextensionyiiclosure tablenested-set

### Embed Badge

![Health badge](/badges/aidask-yii-closure-table-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/aidask-yii-closure-table-behavior/health.svg)](https://phpackages.com/packages/aidask-yii-closure-table-behavior)
```

###  Alternatives

[yiiext/activerecord-relation-behavior

Inspired by and put together the awesomeness of many yii extensions that aim to improve saving of related records. Comes with 100% test coverage and well structured and clean code so it can savely be used in enterprise production enviroment.

9336.9k](/packages/yiiext-activerecord-relation-behavior)[yiiext/migrate-command

This is an enhanced version of the Yii Database Migration Tool that adds module support and many more usefull features.

34174.8k4](/packages/yiiext-migrate-command)[sjaakp/yii2-sortable-behavior

Sort ActiveRecords and related records in Yii2.

36169.5k](/packages/sjaakp-yii2-sortable-behavior)[jiaxincui/closure-table

A closure table tree package for laravel eloquent

1138.6k](/packages/jiaxincui-closure-table)[stefano/stefano-tree

Nested Set(MPTT) implementation for PHP

2790.4k](/packages/stefano-stefano-tree)[sjaakp/yii2-spatial

Yii2 ActiveRecord supporting MySQL spatial data

1877.2k1](/packages/sjaakp-yii2-spatial)

PHPackages © 2026

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