PHPackages                             thingsolution/thingorm - 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. thingsolution/thingorm

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

thingsolution/thingorm
======================

The ORM framework for PHP

058PHP

Since Jun 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ThingSolution/ORM)[ Packagist](https://packagist.org/packages/thingsolution/thingorm)[ RSS](/packages/thingsolution-thingorm/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

ThingORM
========

[](#thingorm)

This is small library to build your query and map result to your Entity object in automatic way.

1. Build Query.
---------------

[](#1-build-query)

\###1.1 Build Select query

```
$query = MySqlQuery::select(['id','name','address'])
    ->from("user")
    ->rightJoin('user_info','user.id','=','user_info.user_id')
    ->where('id','>','3')
    ->whereIn('id',['2','3'])
    ->whereNotIn('id',['3','4'])
    ->whereNull('address')
    ->whereNotNull('name')
    ->whereBetween('name','4444','5555')
    ->whereNotBetween('name','6666','7777')
    ->groupBy('id')
    ->groupBy('name')
    ->having('id','>',30)
    ->having('id','>',30)
    ->orderBy('id','desc')
    ->limit(10)
    ->offset(20);

```

\###1.2 Build Update query

```
$query = MySqlQuery::update()->table("user")
    ->set(['id'=>'1','name'=>'22323'])
    ->innerJoin('user_info','user.id','=','user_info.user_id')
    ->where('name','=','sdsdsd')
    ->where('id','=','2222')
    ->orderBy('name','desc')
    ->limit(10);

```

\###1.3 Build Delete query

```
$query = MySqlQuery::update()->delete()
    ->from('user')
    ->innerJoin('user_info','user_id','=','id')
    ->where('id','=','ssd')
    ->where('name','=','sdsds');

```

\###1.4 Build Insert query

```
$query = MySqlQuery::insert()->into('user')
    ->values(['id'=>'sdsds','name'=>'sdsdsd','created_at'=>array('now()')])
    ->generateSQL();

```

\###1.5 Build Batch Insert query

```
$query = MySqlQuery::batchInsert()->into('user')
    ->values([
        ['name'=>'sdsds','address'=>'wewew','created_at'=>array('now()')],
        ['name'=>'asasa','address'=>'dfdfdf','created_at'=>array('now()')],
        ['name'=>'gggdg','address'=>'sddfsf','created_at'=>array('now()')]
        ])

```

\##2. How to use some mysql function within query with ThingORM For example, you want to use function `now()` in insert query, just use this function by `array(now())` like this:

```
$query = MySqlQuery::insert()->into('user')
    ->values(['id'=>'sdsds','name'=>'sdsdsd','created_at'=>array('now()')])
    ->generateSQL();

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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://avatars.githubusercontent.com/u/848548?v=4)[Michael](/maintainers/hungnv038)[@hungnv038](https://github.com/hungnv038)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/thingsolution-thingorm/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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