PHPackages                             reshik84/yii2-eav-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. reshik84/yii2-eav-behavior

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

reshik84/yii2-eav-behavior
==========================

EAV behavior for ActiveRecord

0221PHP

Since Aug 22Pushed 8y ago2 watchersCompare

[ Source](https://github.com/reshik84/yii2-eav-behavior)[ Packagist](https://packagist.org/packages/reshik84/yii2-eav-behavior)[ RSS](/packages/reshik84-yii2-eav-behavior/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

EAV-behavior

============

EAV behavior for ActiveRecord

Installation

---

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

Either run

```

php composer.phar require --prefer-dist reshik84/yii2-eav-behavior "*"

```

or add

```

"reshik84/yii2-eav-behavior": "*"

```

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

```

$ php yii migrate/up --migrationPath=@vendor/reshik84/yii2-eav-behavior/migrations

```

Usage

---

Once the extension is installed, add to your model :

```
    public function behaviors()
    {
        return [
            'eav' => [
                'class' => resh\eav\behaviors\EavBehavior::className(),
                'model_id' => 'id' // primary key
            ]
        ];
    }

    // list of EAV attributes
    public function additionalAttributes(){
        return ['attr1', 'attr2', 'attr3', ... ];
    }

    public function rules() {
        return [
            [['attr1', 'attr2', 'attr3'], 'safe']
        ];
    }

    public function attributeLabels()
    {
        return [
            'attr1' => 'Attribute 1',
            'attr2' => 'Attribute 2',
            'attr3' => 'Attribute 3',
        ];
    }
```

Call EAV attributes:

```
$model = new Model();
$attr = $model->attr1; // get value
$model->attr1 = 'some value'; // set value
$model->save();
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

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/7973703e5d760c0bb1fbce94eb638b5aee87ad420082da8c7fd289e8d2cec862?d=identicon)[reshik](/maintainers/reshik)

---

Top Contributors

[![reshik84](https://avatars.githubusercontent.com/u/7578328?v=4)](https://github.com/reshik84 "reshik84 (5 commits)")

### Embed Badge

![Health badge](/badges/reshik84-yii2-eav-behavior/health.svg)

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

###  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)
