PHPackages                             subztep/modell - 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. subztep/modell

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

subztep/modell
==============

Model class for PDO

v1.0(10y ago)2181PHP

Since May 25Pushed 9y agoCompare

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

READMEChangelog (1)DependenciesVersions (3)Used By (0)

Modell v1.0
===========

[](#modell-v10)

A PHP class for easily create/update/load database entries. All you need to do is extend this class from your model and enjoy the benefits. It uses PDO connection but I only tested with MySql. I am going to explain the usage with a simple user class.

> Please write your tests well.

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

[](#installation)

Extend your `composer.json` file with the following:

```
{
  "require": {
    "subztep/modell": "dev-master"
  }
}
```

Create data table
-----------------

[](#create-data-table)

Our user table will contains name and email. Each plural table require an `id` int primary key field. Optional `created_at` and `updated_at` datetime columns for log your updates, recommended.

```
CREATE TABLE `users` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(30) NOT NULL,
 `email` varchar(255) DEFAULT NULL,
 `created_at` datetime DEFAULT NULL,
 `updated_at` datetime DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```

Usage with PHP
--------------

[](#usage-with-php)

Connect to database

```
Modell::$pdo = new PDO('mysql:host=HOST;dbname=DBNAME;charset=utf8', 'USER', 'PASS');
```

Connect to memcache is *optional*. If connected, *Modell* cache your table's column details and make it faster.

```
Modell::$memcache = new Memcache;
Modell::$memcache->connect('localhost', 11211);
```

Create table `users` with primary key `id`, and add *Modell* class to your project

```
class User extends Modell {
}
```

Furthermore, you can run any sql query, connection in singleton.

```
$query = Modell::$pdo->prepare($sql);

```

Examples
--------

[](#examples)

Create user

```
$user = new User();
$user->name = 'John Doe';
$user->save();

```

Load user by id

```
$user = new User(1);
echo $user->name;

```

Update user by id

```
$user = new User(1);
$user->name = 'John Roe';
$user->save();

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Unknown

Total

1

Last Release

4012d ago

### Community

Maintainers

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

---

Top Contributors

[![SubZtep](https://avatars.githubusercontent.com/u/1309831?v=4)](https://github.com/SubZtep "SubZtep (13 commits)")

### Embed Badge

![Health badge](/badges/subztep-modell/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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