PHPackages                             motin/yii-owner-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. motin/yii-owner-behavior

ActiveLibrary

motin/yii-owner-behavior
========================

Behavior to automate setting the "owned by user" attribute to the currently logged in user id upon creation of a record.

09PHP

Since Nov 20Pushed 12y agoCompare

[ Source](https://github.com/motin/yii-owner-behavior)[ Packagist](https://packagist.org/packages/motin/yii-owner-behavior)[ RSS](/packages/motin-yii-owner-behavior/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii Extension: OwnerBehavior
============================

[](#yii-extension-ownerbehavior)

Behavior to automate setting the "owned by user" attribute to the currently logged in user id upon creation of a record.

Setup
-----

[](#setup)

### Download and install

[](#download-and-install)

Ensure that you have the following in your composer.json:

```
"repositories":[
    {
        "type": "vcs",
        "url": "https://github.com/motin/yii-owner-behavior"
    },
    ...
],
"require":{
    "motin/owner-behavior":"@dev",
    ...
},

```

Then install through composer:

```
php composer.php update motin/yii-owner-behavior

```

If you don't use composer, clone or download this project into /path/to/your/app/vendor/motin/owner-behavior

### Import the behavior in main.php

[](#import-the-behavior-in-mainphp)

```
'import' => array(
    ...
    'vendor.motin.yii-owner-behavior.OwnerBehavior',
    ...
),

```

### Configure models to be part of the qa process

[](#configure-models-to-be-part-of-the-qa-process)

```
public function behaviors()
{
    return array(
        'owner-behavior' => array(
             'class' => 'OwnerBehavior',
        ),
    );
}

```

Changelog
---------

[](#changelog)

### 0.1.0

[](#010)

- Only setting the attribute if it is null, so that one can specify the field manually before hitting insert()/save()

### 0.0.0

[](#000)

- Forked/revived thyseus  OwnerBehavior from

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

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/d71e1dd8ef0c10991227f77fbc40e68504121455a0ec42e3ae7d05630f47605c?d=identicon)[motin](/maintainers/motin)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/motin-yii-owner-behavior/health.svg)

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

PHPackages © 2026

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