PHPackages                             roistat/php-orm - 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. roistat/php-orm

ActiveLibrary

roistat/php-orm
===============

Simple ORM library for PHP

8266PHP

Since Mar 3Pushed 2y ago3 watchersCompare

[ Source](https://github.com/roistat/php-orm)[ Packagist](https://packagist.org/packages/roistat/php-orm)[ RSS](/packages/roistat-php-orm/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

RsORM
=====

[](#rsorm)

[![Build Status](https://camo.githubusercontent.com/a2d8a8665afdc25a9cc825e77260c9b2bef851cf006727814c752736bed8700b/68747470733a2f2f7472617669732d63692e6f72672f726f69737461742f7068702d6f726d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/roistat/php-orm)

Overview
--------

[](#overview)

It is simple ORM library for PHP. This library is compatible with PHP 5.4 and higher. There are no magic methods. All code is type-hinted. It could be used in high load projects even with partitioning and sharding. There are 3 basic parts (packages). You could combine them or use some of them separately.

- State package — responsible for object state management. Prepares data for usage in DB queries.
- Query package — query builder. It could use data from State package or any other sources.
- Driver package — sends queries to database and parses results.

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

[](#installation)

```
composer require roistat/php-orm:dev-master

```

Or you can't just copy content of `./src` to your `src/RsORM` folder with standard namespaces autoload.

Quick Start
-----------

[](#quick-start)

Typically you can combine these 3 packages or use them alone. And at first you should define class of entity you work with. This class structure convenient to build accordingly with DB table structure.

```
class Account extends State\Entity {
	public $id;
	public $email;
	public $password;
}
```

Then you can build MySQL query. For example, select statement.

```
$statement = Query\Engine\MySQL\Builder::select()
	->table("accounts")
    ->build();
```

And then you can execute this statement and get result (array of defined class objects).

```
$mysql = new Driver\MySQL();
$accounts = $mysql->fetchAllClass($statement, "Account");
/*
$accounts - array of Account objects, like this:
[
	{id: 1, email: "qwe@qwe.qwe", password: "123456"},
	{id: 2, email: "asd@asd.asd", password: "654321"},
	...
]
*/
```

It is simple example of usage RsORM. More detailed information you can find in the relevant sections.

Documentation
-------------

[](#documentation)

[**State package**](docs/state.md)
[**Query package**](docs/query.md)
[**Driver package**](docs/driver-mysql.md)

License
-------

[](#license)

Released under the MIT License.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 56.8% 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/d9edbba6a801944f98d4cb06b8e2ad5e3a4541f45464280a19b7160d21ac6fce?d=identicon)[boliev](/maintainers/boliev)

---

Top Contributors

[![slyshkin](https://avatars.githubusercontent.com/u/19598461?v=4)](https://github.com/slyshkin "slyshkin (155 commits)")[![flrnull](https://avatars.githubusercontent.com/u/1926460?v=4)](https://github.com/flrnull "flrnull (114 commits)")[![boliev](https://avatars.githubusercontent.com/u/1892918?v=4)](https://github.com/boliev "boliev (3 commits)")[![Farengier](https://avatars.githubusercontent.com/u/8510580?v=4)](https://github.com/Farengier "Farengier (1 commits)")

### Embed Badge

![Health badge](/badges/roistat-php-orm/health.svg)

```
[![Health](https://phpackages.com/badges/roistat-php-orm/health.svg)](https://phpackages.com/packages/roistat-php-orm)
```

PHPackages © 2026

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