PHPackages                             platine-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. [Framework](/categories/framework)
4. /
5. platine-php/orm

ActiveLibrary[Framework](/categories/framework)

platine-php/orm
===============

Platine ORM provides a flexible and powerful ORM implementing a data-mapper pattern.

v2.0.1(5mo ago)17.9k[1 PRs](https://github.com/platine-php/orm/pulls)1MITPHPPHP ^8CI passing

Since Dec 5Pushed 1mo ago1 watchersCompare

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

READMEChangelog (3)Dependencies (6)Versions (6)Used By (1)

PLATINE ORM
-----------

[](#platine-orm)

**Platine ORM provides a flexible and powerful ORM implementing a data-mapper pattern.**

[![Project Status](https://camo.githubusercontent.com/5b5a2250da48f45495a817a4bcdabb5d101fff298acebe00a55a52815b7119ed/687474703a2f2f6f70656e736f757263652e626f782e636f6d2f6261646765732f6163746976652e737667)](http://opensource.box.com/badges)[![Latest Stable Version](https://camo.githubusercontent.com/0ee46d07ec3486fe51e3dc80fc20b6ae63348230fca67dc18fc03b4d685195e9/68747470733a2f2f706f7365722e707567782e6f72672f706c6174696e652d7068702f6f726d2f76)](https://packagist.org/packages/platine-php/orm)[![Latest Unstable Version](https://camo.githubusercontent.com/b3a88c937da5d773edff4e72d9ef294904a16b180ca191fd618ccf512ee295d2/68747470733a2f2f706f7365722e707567782e6f72672f706c6174696e652d7068702f6f726d2f762f756e737461626c65)](https://packagist.org/packages/platine-php/orm)[![Total Downloads](https://camo.githubusercontent.com/88a6bd2e8e8fe5578c6814ad962bdf4d09ddcca378d10f8aea9704e7f86cd08e/68747470733a2f2f706f7365722e707567782e6f72672f706c6174696e652d7068702f6f726d2f646f776e6c6f616473)](https://packagist.org/packages/platine-php/orm)[![License](https://camo.githubusercontent.com/5e8aaf091b3c74c9f3b14115b8e62949a0d7ec77eb0cf619d2adb60a179dbff1/68747470733a2f2f706f7365722e707567782e6f72672f706c6174696e652d7068702f6f726d2f6c6963656e7365)](https://packagist.org/packages/platine-php/orm)
[![Tests](https://github.com/platine-php/orm/actions/workflows/ci.yml/badge.svg)](https://github.com/platine-php/orm/actions/workflows/ci.yml/badge.svg)[![Quality Score](https://camo.githubusercontent.com/b679b53a1690dc1092da2d6dc051f474c5dc1674d383b807ee5f631f537b49b4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706c6174696e652d7068702f6f726d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/platine-php/orm)[![Codacy Badge](https://camo.githubusercontent.com/d19448eac5dcbd9f79f38678707758e9530bd21afff534051068f45e3121e76f/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3835326533353234353536343463386162643832303966323033366561616232)](https://app.codacy.com/gh/platine-php/orm/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Codacy Badge](https://camo.githubusercontent.com/90c631ca6b284adf48129b73cbd1ccfa94828823c0c9c901a79ff7b0705ddaca/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3835326533353234353536343463386162643832303966323033366561616232)](https://app.codacy.com/gh/platine-php/orm/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

### Requirements

[](#requirements)

- **PHP &gt;= 8.0**

### Installation

[](#installation)

#### Using composer (recommended)

[](#using-composer-recommended)

```
composer require platine-php/orm
```

### License

[](#license)

MIT License See [LICENSE.MD](LICENSE.MD)

### Resources

[](#resources)

- [Documentation](https://docs.platine-php.com/packages/orm)

### Change make to opis/orm version 1.0.x-dev

[](#change-make-to-opisorm-version-10x-dev)

**Platine ORM** get inspiration from **opis/orm**. All notable changes to [opis/orm](https://github.com/opis/orm) are documented below.

#### Global changes

[](#global-changes)

- Update code to PHP 7.4 (typed properties, **object** type, etc.)
- Add **declare(strict\_types=1);** in all files
- Change all namespace **Opis\\ORM** to **Platine\\Orm**
- Add interface **RepositoryInterface** and class **Repository**
- Move classes **IEntityMapper, IDataMapper, EntityMapper, DataMapper, Proxy** to **Platine\\Orm\\Mapper**
- Move classes **Query, EntityQuery** to **Platine\\Orm\\Query**
- Rename interface **IEntityMapper** to **EntityMapperInterface**
- Rename interface **IDataMapper** to **DataMapperInterface**
- Move method **mapEntity** of interface **IMappableEntity** to **Entity** class and set as abstract method to force each child class to implements it
- Remove interface **IMappableEntity**
- Move classes **ForeignKey, PrimaryKey, Junction, Relation, RelationFactory, LazyLoader, BelongsTo, HasOneOrMany, ShareOneOrMany** to **Platine\\Orm\\Relation**
- Rename class **LazyLoader** to **RelationLoader**
- Add new abstract class **ShareRelation** in **Platine\\Orm\\Relation** to containt the implemention of **ShareOneOrMany**
- Add new abstract class **HasRelation** in **Platine\\Orm\\Relation** to containt the implemention of **HasOneOrMany**
- Extract class **ShareOneOrMany** into two classes **ShareOne** and **ShareMany**
- Extract class **HasOneOrMany** into two classes **HasOne** and **HasMany**
- Add Exceptions packages under namespace **Platine\\Database\\Exception**
- Change all typehint array to array notation based on static analysis tools (phpstan), example array&lt;int, string&gt;, etc.
- In each class reorder all methods based on modifier **public -&gt; protected -&gt; private**
- Move trait **LoaderTrait, SelectTrait, SoftDeletesTrait** functionality to **Query** class
- Move trait **AggregateTrait** functionality to **EntityQuery** class

#### Details change

[](#details-change)

##### Class EntityMapperInterface

[](#class-entitymapperinterface)

- Rename method **entityName** to **name**
- Rename method **assignable** to **fillable**
- Set default value of parameter **$column** to **deleted\_at** of method **useSoftDelete**
- Rename parameter **created\_at** to **createdAt** of method **useTimestamp**
- Rename parameter **updated\_at** to **updatedAt** of method **useTimestamp**

##### Class EntityMapper

[](#class-entitymapper)

- Rename attribute **entityName** to **name**
- Rename attribute **assignable** to **fillable**
- Rename attribute **softDelete** to **useSoftDelete**
- Rename attribute **timestamp** to **useTimestamp**
- Rename method **getEntityName** to **getName**
- Rename method **getClass** to **getEntityClass**
- Rename method **getTypeCasts** to **getCasts**
- Rename method **supportsSoftDelete** to **hasSoftDelete**
- Rename method **supportsTimestamp** to **hasTimestamp**
- Rename method **getAssignableColumns** to **getFillable**
- Rename method **getGuardedColumns** to **getGuarded**
- Add the possibility to use many event handlers for one event in method **on**

##### Class Entity

[](#class-entity)

- Rename method **orm** to **mapper**
- add maggic methods **\_\_get, \_\_set, \_\_isset**

##### Class PrimaryKey

[](#class-primarykey)

- Rename method **valueFromDataMapper** to **getValueFromDataMapper**
- Rename method **valueFromEntity** to **getValueFromEntity**

##### Class Proxy

[](#class-proxy)

- Rename attribute **ormMethod** to **mapperMethod**
- Rename method **getDataMapper** to **getEntityDataMapper**

##### Class Relation

[](#class-relation)

- Rename method **getLazyLoader** to **getLoader**

##### Class DataMapperInterface

[](#class-datamapperinterface)

- Rename method **assign** to **fill**
- Rename method **stale** to **refresh**
- Add methods **hasColumn** and **hasRelated**
- Remove parameter **$callback** of method **getRelated**

##### Class DataMapper

[](#class-datamapper)

- Rename method **assign** to **fill**
- Rename method **linkOrUnlink** to **setLink**
- Rename attribute **stale** to **refresh**

##### Class EntityManager

[](#class-entitymanager)

- Rename method **resolveEntityMapper** to **getEntityMapper**

##### Class Query

[](#class-query)

- Rename attribute **have** to **havingStatement**
- Rename method **onlySoftDeleted** to **onlyDeleted**
- Rename method **withSoftDeleted** to **withDeleted**

##### Class EntityQuery

[](#class-entityquery)

- Rename method **getLazyLoaders** to **getRelationLoaders**
- Remove parameter **$default** of method **transaction**

##### Class EntityManager

[](#class-entitymanager-1)

- Remove attribute **entityMappingCallbacks** and **compiler**
- Remove methods **\_\_invoke, registerMappingCallback, getCompiler**
- Remove parameter **$callbacks** of method **\_\_construct**
- Move methods **save, create, delete** to class **RepositoryInterface**

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance82

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

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 ~385 days

Total

3

Last Release

160d ago

Major Versions

v1.0.0 → v2.0.02025-09-18

PHP version history (2 changes)v1.0.0PHP ^7.4 || ^8

v2.0.0PHP ^8

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16177981?v=4)[Tony NGUEREZA](/maintainers/nguereza-tony)[@nguereza-tony](https://github.com/nguereza-tony)

---

Top Contributors

[![nguereza-tony](https://avatars.githubusercontent.com/u/16177981?v=4)](https://github.com/nguereza-tony "nguereza-tony (40 commits)")

---

Tags

phpframeworkdatabaseormpdoquerymapperapplicationactiverecordplatine

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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