PHPackages                             artemeon/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. [Database &amp; ORM](/categories/database)
4. /
5. artemeon/orm

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

artemeon/orm
============

v1.2.0(2w ago)052.5k↓14.5%MITPHPPHP &gt;=8.4CI passing

Since Sep 25Pushed 2w ago3 watchersCompare

[ Source](https://github.com/artemeon/orm)[ Packagist](https://packagist.org/packages/artemeon/orm)[ RSS](/packages/artemeon-orm/feed)WikiDiscussions 1.x Synced 2d ago

READMEChangelog (2)Dependencies (22)Versions (10)Used By (0)

ORM
===

[](#orm)

This repository contains the ORM of the AGP platform. It is extracted from the internal ORM into a general ORM which can be also used in other projects. It is still a work-in-progress but the idea is to eventually replace the AGP internal ORM.

Ideas
-----

[](#ideas)

The main idea behind the ORM is really simple, basically you can attach to your entity `TableColumn` attributes and based on those attributes the ORM builds the table structure. It has a special inheritance handling so that every parent will have its own table. The ORM then automatically joins those tables on select.

```
#[TableName('agp_contracts_con')]
class TestModel extends TestParent
{
    #[TablePrimary('contract_id')]
    private string $contractId;

    #[TableColumn('servicerid', DataType::STR_TYPE_CHAR20)]
    private $strServicerId;

    #[TableColumn('inhouseservice', DataType::STR_TYPE_INT)]
    private $intInhouseService;

    #[TableColumn('outsourcing_i', DataType::STR_TYPE_CHAR20)]
    private ?string $outsourcingInstitution = null;

    #[TableColumn('purchasing_relevance', DataType::STR_TYPE_INT)]
    private ?int $purchasingRelevance = 0;

    // getter/setter
}

#[TableName('agp_system')]
class TestParent implements EntityInterface
{
    #[TablePrimary('system_id')]
    private string $systemId;

    #[TableColumn('owner', DataType::STR_TYPE_CHAR20)]
    private ?string $owner = null;

    // getter/setter
}
```

Those entity classes would generate two tables `agp_system` and `agp_contracts_con` with the fitting columns.

Design
------

[](#design)

This ORM follows the Data-Mapper Pattern, this means your entities are simple PHP classes where you only define the properties and getter/setter, your entity does not contain any business logic. To CRUD an entity you need to use the `EntityManager`.

Goals
-----

[](#goals)

### Root is not required

[](#root-is-not-required)

Currently every entity must extend from the `Root` entity which maps to the `agp_system` table. This means that every entity has an entry in the `agp_system` table, because of this the `agp_system` table becomes really large. With this ORM we have the possibility to create an entity without extending from the `Root` entity, this brings us more flexibility and in the end also better performance.

### Compatibility

[](#compatibility)

We try to use this ORM as drop-in replacement for the current ORM, so that we dont need to change the logic of each model. In the future we might also completely change the ORM but this should be a second step.

### Improved column options

[](#improved-column-options)

Currently we have not the option to specify a column length, the length is integrated in the data type. This should provide a way to set custom length for a column.

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance97

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~125 days

Total

8

Last Release

15d ago

Major Versions

v0.1.2 → v1.0.02025-02-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16920430?v=4)[ARTEMEON](/maintainers/artemeon)[@artemeon](https://github.com/artemeon)

---

Top Contributors

[![marcreichel](https://avatars.githubusercontent.com/u/7645035?v=4)](https://github.com/marcreichel "marcreichel (25 commits)")[![chriskapp](https://avatars.githubusercontent.com/u/2505846?v=4)](https://github.com/chriskapp "chriskapp (19 commits)")[![tmArtemeon](https://avatars.githubusercontent.com/u/187274518?v=4)](https://github.com/tmArtemeon "tmArtemeon (8 commits)")[![akonoval](https://avatars.githubusercontent.com/u/11173056?v=4)](https://github.com/akonoval "akonoval (3 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k300.5M7.5k](/packages/doctrine-orm)[getgrav/grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS

15.6k86.4k1](/packages/getgrav-grav)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[directorytree/ldaprecord

A fully-featured LDAP ORM.

5793.4M17](/packages/directorytree-ldaprecord)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[patchlevel/event-sourcing

A lightweight but also all-inclusive event sourcing library with a focus on developer experience

207362.9k13](/packages/patchlevel-event-sourcing)

PHPackages © 2026

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