PHPackages                             idealia/yii2-children-count-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. idealia/yii2-children-count-behavior

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

idealia/yii2-children-count-behavior
====================================

Behavior for counting records in the dependent objects and updating the relevant column after insert, edit and remove any child record.

2261PHP

Since Feb 16Pushed 10y ago4 watchersCompare

[ Source](https://github.com/Idealia/yii2-children-count-behavior)[ Packagist](https://packagist.org/packages/idealia/yii2-children-count-behavior)[ RSS](/packages/idealia-yii2-children-count-behavior/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-children-count-behavior
============================

[](#yii2-children-count-behavior)

Behavior for counting records in the dependent objects and updating the relevant column after insert, edit and remove any child record.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require idealia/yii2-children-count-behavior "*"
```

or add

```
"idealia/yii2-children-count-behavior": "*"
```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

```
public function behaviors()
{
     return [
         [
             'class' => ChildrenCountBehavior::className(),
             'countRelation' => 'getDocuments',
             'parentRelation' => 'getTask',
             'columnToUpdate' => 'document_count'
         ],
     ];
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b4c32d3e8496b6d73037dfa3faf736602d147c92d0403cf51593e095e313dda?d=identicon)[pgrzelka](/maintainers/pgrzelka)

---

Top Contributors

[![piotr-grzelka](https://avatars.githubusercontent.com/u/1458551?v=4)](https://github.com/piotr-grzelka "piotr-grzelka (8 commits)")

### Embed Badge

![Health badge](/badges/idealia-yii2-children-count-behavior/health.svg)

```
[![Health](https://phpackages.com/badges/idealia-yii2-children-count-behavior/health.svg)](https://phpackages.com/packages/idealia-yii2-children-count-behavior)
```

###  Alternatives

[kris/laravel-form-builder

Laravel form builder - symfony like

1.7k2.2M45](/packages/kris-laravel-form-builder)

PHPackages © 2026

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