PHPackages                             aweitian/model - 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. aweitian/model

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

aweitian/model
==============

mysql ORM

v1.1.0(4y ago)09MITPHPPHP &gt;=5.3.0

Since Oct 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/aweitian/model)[ Packagist](https://packagist.org/packages/aweitian/model)[ Docs](https://github.com/aweitian/model)[ RSS](/packages/aweitian-model/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

model
=====

[](#model)

model，第一版只包含:ORM

静态调用
----

[](#静态调用)

```
namespace App\Model
class Model {
    public static function __callStatic($method, $arguments)
    {
        $m = new static(Application::getInstance()->make('mysql'));
        return $m->__call($method, $arguments);
    }
}
```

其它Model继承这个类就可以

select one
----------

[](#select-one)

```
$model = new Admin();
$row = $model->find(1);
echo $row->admin_id;
```

select
------

[](#select)

```
$model = new Admin();
$rows = $model->where('admin_id','>',1)->select();
foreach($rows as $row) {
    echo $row->admin_id;
}
```

insert
------

[](#insert)

```
$model = new Admin();
$model->name = "gondar";
$model->sex = "male";
echo $model->save(); //insert into
```

update one
----------

[](#update-one)

```
$model = new Admin();
$model2 = $model->find(1);
$model2->name = "gondar";
$model2->sex = "male";
echo $model2->save(); //affected rows
```

update
------

[](#update)

```
$model = new Admin();
echo $model->where('admin_id','>',1)->update([
    'name' => 'aa',
    'sex' => 'male'
]);
//affected rows
```

drop
----

[](#drop)

```
$model = new Admin();
$model->find(1)->drop();
//affected rows
```

delete
------

[](#delete)

```
$model = new Admin();
$model->where('name','cc')->delete();
//affected rows
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~1 days

Total

6

Last Release

1658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f29043b8f5aebb2d7a34302c1bc1626bd711398bb0c5387cd8630b45057a4c9?d=identicon)[awei.tian](/maintainers/awei.tian)

---

Top Contributors

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

---

Tags

phpsms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aweitian-model/health.svg)

```
[![Health](https://phpackages.com/badges/aweitian-model/health.svg)](https://phpackages.com/packages/aweitian-model)
```

###  Alternatives

[eftec/pdoone

Minimaist procedural PDO wrapper library

1105.9k9](/packages/eftec-pdoone)[simple-swoole/db

A db component for Simps.

216.3k3](/packages/simple-swoole-db)

PHPackages © 2026

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