PHPackages                             lusito/notorm - 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. lusito/notorm

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

lusito/notorm
=============

NotORM is a PHP library for simple working with data in the database.

0.8(6y ago)2911ZlibPHPPHP ^7.1.0

Since Jun 20Pushed 6y agoCompare

[ Source](https://github.com/Lusito/notorm)[ Packagist](https://packagist.org/packages/lusito/notorm)[ Docs](https://github.com/lusito/notorm)[ RSS](/packages/lusito-notorm/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

NotORM - simple reading data from the database
==============================================

[](#notorm---simple-reading-data-from-the-database)

Dual licensed (one or the other)

[![License](https://camo.githubusercontent.com/4cc1d6612eabf89ec72b56f6d5cc92f8459be2a535f52c69fb0f4ad9f55f1dae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d41706163686525323056322d626c75652e737667)](http://www.apache.org/licenses/LICENSE-2.0) [![License](https://camo.githubusercontent.com/f39dcacc07a4d4defd34223fd51b1e2ade074a84473270a1c86e9aef5a736aea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323056322d626c75652e737667)](http://www.gnu.org/licenses/gpl-2.0.html)

This is a fork of  (original author Jakub Vrana, copyright 2010)

NotORM is a PHP library for simple working with data in the database. The most interesting feature is, that it's very easy work with table relationships. The overall performance is also very important and NotORM can actually run faster than a native driver.

### About this fork

[](#about-this-fork)

- The original code has not been maintained in years.
- I needed a PSR-4 version of it
- I refactored the code a bit
- I ported the code to PHP 7.1
- I added a couple of extra features
- Usage has been left mainly untouched

### Requirements

[](#requirements)

- PHP &gt;= 7.1
- any database supported by PDO (tested with MySQL, SQLite, PostgreSQL, MS SQL, Oracle)

### Installation

[](#installation)

Install via composer:

`composer require lusito/notorm:dev-master`

Include the autoloader in your php script, unless you've done that already:

```
require __DIR__ . '/vendor/autoload.php';
```

### Usage

[](#usage)

Setup is a bit different to the original NotORM. At first you need to create a Config object:

```
use Lusito\NotORM\ConfigBuilder;

$dsn = 'mysql:host=' . $hostname . ';dbname=' . $database;
$config = (new ConfigBuilder($dsn, $username, $password))->build();
```

ConfigBuilder allows for various settings to be made. We'll come to that later.

After that, you can use it in the classic way or the new way I'm proposing.

The classic way:

```
use Lusito\NotORM\Database;

$db = new Database($config);

foreach ($db->application()->order("title") as $application) { // get all applications ordered by title
    echo "$application[title]\n"; // print application title
    echo $application->author["name"] . "\n"; // print name of the application author
    foreach ($application->application_tag() as $application_tag) { // get all tags of $application
        echo $application_tag->tag["name"] . "\n"; // print the tag name
    }
}
```

The new way uses a static class:

```
use Lusito\NotORM\DB;

DB::setConfig($config);

foreach (DB::application()->order("title") as $application) { // get all applications ordered by title
    // ...
}
```

This new approach helps you to avoid passing the database instance to every class where you need it (or even setting it globally).

Use `DB::hasConfig()` to check if the DB has been set up.

### Differences of the new approach

[](#differences-of-the-new-approach)

ActionClassicNewGet table`$db->table_name(...$where)``DB::table_name(...$where)`Get table (by name)`$db->__call('table_name', ...$where)``DB::getTable('table_name', ...$where)`Get row by id`$db->table_name[$id]``DB::getRow('table_name', $id)`Set a config value (for example debug, debugTimer, freeze, rowClass or jsonAsArray)`$db->debug = true;``DB::setConfigValue('debug', true);`Begin a transaction`$db->transaction = 'BEGIN';``DB::beginTransaction()`Commit a transaction`$db->transaction = 'COMMIT';``DB::commitTransaction()`Rollback a transaction`$db->transaction = 'ROLLBACK';``DB::rollbackTransaction()`### License

[](#license)

The code is dual licensed (one or the other)

- [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
- [GNU General Public License, Version 2](http://www.gnu.org/licenses/gpl-2.0.html)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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

2520d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c9f1143a4a1ff6fbd0051287a9734a082e589ca04c93de85f47103301fe4f04?d=identicon)[Lusito](/maintainers/Lusito)

---

Top Contributors

[![vrana](https://avatars.githubusercontent.com/u/117453?v=4)](https://github.com/vrana "vrana (236 commits)")[![Lusito](https://avatars.githubusercontent.com/u/1135267?v=4)](https://github.com/Lusito "Lusito (12 commits)")[![mkozhukh](https://avatars.githubusercontent.com/u/2178224?v=4)](https://github.com/mkozhukh "mkozhukh (2 commits)")[![dg](https://avatars.githubusercontent.com/u/194960?v=4)](https://github.com/dg "dg (1 commits)")[![wergio](https://avatars.githubusercontent.com/u/1130260?v=4)](https://github.com/wergio "wergio (1 commits)")[![xblitz](https://avatars.githubusercontent.com/u/592097?v=4)](https://github.com/xblitz "xblitz (1 commits)")[![zacharymarshal](https://avatars.githubusercontent.com/u/321407?v=4)](https://github.com/zacharymarshal "zacharymarshal (1 commits)")

---

Tags

databasepdonotorm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lusito-notorm/health.svg)

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[nette/database

💾 Nette Database: layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.

5656.7M234](/packages/nette-database)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[morris/lessql

LessQL: A lightweight and performant PHP ORM alternative

405140.0k3](/packages/morris-lessql)[dibi/dibi

Dibi is Database Abstraction Library for PHP

5013.8M120](/packages/dibi-dibi)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)

PHPackages © 2026

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