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.1.0(8mo ago)048.4k—8.3%MITPHPPHP &gt;=8.4CI passing

Since Sep 25Pushed 4mo ago3 watchersCompare

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

READMEChangelog (1)Dependencies (11)Versions (9)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

47

—

FairBetter than 94% of packages

Maintenance69

Regular maintenance activity

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

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

Recently: every ~204 days

Total

7

Last Release

126d ago

Major Versions

v0.1.2 → v1.0.02025-02-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c87366e3237b8eed0a163e8a3c14a76418d7a82d34911d205585457a361ea8d?d=identicon)[artemeon](/maintainers/artemeon)

---

Top Contributors

[![marcreichel](https://avatars.githubusercontent.com/u/7645035?v=4)](https://github.com/marcreichel "marcreichel (24 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.2k285.3M6.2k](/packages/doctrine-orm)[gedmo/doctrine-extensions

Doctrine behavioral extensions

4.1k118.8M366](/packages/gedmo-doctrine-extensions)[getgrav/grav

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

15.4k84.1k1](/packages/getgrav-grav)[doctrine/mongodb-odm

PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to MongoDB.

1.1k23.3M302](/packages/doctrine-mongodb-odm)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[kreait/firebase-bundle

Symfony Bundle for the Firebase Admin SDK

1534.7M2](/packages/kreait-firebase-bundle)

PHPackages © 2026

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