PHPackages                             fgh151/yii2-postgresql-array-field - 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. fgh151/yii2-postgresql-array-field

ActiveLibrary[Database &amp; ORM](/categories/database)

fgh151/yii2-postgresql-array-field
==================================

Yii2 postgresql jsonb field support behavior

v0.0.1(9y ago)087MITPHPPHP &gt;=5.4.0CI failing

Since Oct 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fgh151/yii2-postgresql-array-field)[ Packagist](https://packagist.org/packages/fgh151/yii2-postgresql-array-field)[ RSS](/packages/fgh151-yii2-postgresql-array-field/feed)WikiDiscussions master Synced 1mo ago

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

yii2-postgresql-array-field
===========================

[](#yii2-postgresql-array-field)

Yii2 postgresql object field support behavior

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

Provides PostgreSQL object fields support for yii2 models.

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

[](#installation)

Add a dependency to your project's composer.json:

```
{
	"require": {
		"fgh151/yii2-postgresql-array-field": "*"
	}
}
```

Migration example
-----------------

[](#migration-example)

```
$this->createTable('UserReward', [
    'jsonField' => fgh151\PostgresqlJsonb\db\Schema::TYPE_JSONB
]);
```

Usage example
-------------

[](#usage-example)

#### Attach behavior to one or more fields of your model

[](#attach-behavior-to-one-or-more-fields-of-your-model)

```
use yii\db\ActiveRecord;
use \fgh151\PostgresqlJsonb\PostgresqlJsonbFieldBehavior;

/**
 * @property array $modelField
 */
class Model extends ActiveRecord{
	public function behaviors() {
		return [
			[
				'class' => PostgresqlJsonbFieldBehavior::className(),
				'arrayFieldName' => 'modelField', // model's field to attach behavior
				'onEmptySaveNull' => true // if set to false, empty array will be saved as empty PostreSQL array '{}' (default: true)
			]
		];
	}
}
```

```
$model->jsonField->property = 'value';
$model->jsonField->otherProperty->otherPropertyValue = 'another value';
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3501d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81832b7ce373292df19cf8083a15a64210e41ecac3cd8184d80d9c81a85d86d1?d=identicon)[fgh151](/maintainers/fgh151)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/fgh151-yii2-postgresql-array-field/health.svg)

```
[![Health](https://phpackages.com/badges/fgh151-yii2-postgresql-array-field/health.svg)](https://phpackages.com/packages/fgh151-yii2-postgresql-array-field)
```

###  Alternatives

[yii2tech/illuminate

Yii2 to Laravel Migration Package

11315.1k](/packages/yii2tech-illuminate)[mootensai/yii2-relation-trait

Yii 2 Models load with relation, &amp; transaction save with relation

47220.3k9](/packages/mootensai-yii2-relation-trait)[nhkey/yii2-activerecord-history

Storage history of changes to ActiveRecord

46143.4k1](/packages/nhkey-yii2-activerecord-history)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[urbanindo/yii2-dynamodb

DynamoDB extensions for Yii2

1471.4k](/packages/urbanindo-yii2-dynamodb)[spanjeta/yii2-backup

Database Backup and Restore functionality

285.0k1](/packages/spanjeta-yii2-backup)

PHPackages © 2026

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