PHPackages                             suver/yii2-behavior-subset - 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. suver/yii2-behavior-subset

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

suver/yii2-behavior-subset
==========================

Behavior Subset

1.1.2(7y ago)054Apache-2.0HTML

Since Oct 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/suver/yii2-behavior-subset)[ Packagist](https://packagist.org/packages/suver/yii2-behavior-subset)[ RSS](/packages/suver-yii2-behavior-subset/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (1)Versions (4)Used By (0)

Frapse Behavior Subset
======================

[](#frapse-behavior-subset)

Behavior Subset

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

[](#installation)

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

Either run

```
php composer.phar require suver/yii2-behavior-subset

```

or add

```
"suver/yii2-behavior-subset": "*"

```

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

Configure
---------

[](#configure)

Write you behaviors section like this for Many-To-Many

```
public function behaviors()
{
    return [
        [
            'class' => '\suver\behavior\Subset',
            'relation' => 'authors', // you relation
            'attribute' => 'authors_ids',
        ]
    ];
}

/**
 * Relation with Other Model
 *
 * @return \yii\db\ActiveQuery
 */
public function getAuthors()
{
    return $this->hasMany(OtherModel::className(), ['id' => 'other_model_id'])->viaTable('this_model_to_other_model', ['this_model_id' => 'id']);
}
```

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

```
// save relation
$model->authors_ids = [1,2,3,4];
$model->save();

// get realtion
var_dump($model->authors)
```

yii2-behavior-subset
====================

[](#yii2-behavior-subset)

Behavior subset. Esey work with many to many relations

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

2618d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccd15c217e2d921f6a654ee6856e8ac7f3536ac88f31e3bf75d10d697a05ffcb?d=identicon)[suver](/maintainers/suver)

---

Top Contributors

[![butkoden](https://avatars.githubusercontent.com/u/494321?v=4)](https://github.com/butkoden "butkoden (9 commits)")

---

Tags

yii2extensionBehaviorsubsetfarpse

### Embed Badge

![Health badge](/badges/suver-yii2-behavior-subset/health.svg)

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

###  Alternatives

[sjaakp/yii2-taggable

Manage tags of ActiveRecord in Yii2.

3031.8k](/packages/sjaakp-yii2-taggable)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

1831.2k](/packages/mdmsoft-yii2-autonumber)[valentinek/yii2-closure-table-behavior

This extension allows you to get functional for closure table trees.

1615.4k](/packages/valentinek-yii2-closure-table-behavior)[v0lume/yii2-meta-tags

DB based model meta data for SEO

194.1k](/packages/v0lume-yii2-meta-tags)

PHPackages © 2026

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