PHPackages                             denisyu-1/articulate - 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. denisyu-1/articulate

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

denisyu-1/articulate
====================

Context-bounded PHP ORM for domain-driven applications

v0.1.1(2mo ago)18[3 issues](https://github.com/DenisYu-1/articulate/issues)Apache-2.0PHPPHP &gt;=8.4CI passing

Since Feb 26Pushed 1mo agoCompare

[ Source](https://github.com/DenisYu-1/articulate)[ Packagist](https://packagist.org/packages/denisyu-1/articulate)[ Docs](https://github.com/DenisYu-1/articulate)[ RSS](/packages/denisyu-1-articulate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (5)Used By (0)

Articulate
==========

[](#articulate)

Context-bounded PHP ORM for domain-driven applications

The Problem
-----------

[](#the-problem)

Traditional ORMs force one entity class per table. Auth needs only `login` and `password`, but it loads `phones`, `groups`, `cart`, and every other relation. The admin panel needs different fields than the API. Adding one relation to a `User` entity affects every consumer of that class.

The entity manager accumulates objects in memory for the entire request or process. Long-running jobs, batch imports, or complex flows have no way to release entities that are no longer needed without detaching everything.

 [![Articulate Logo](logo.svg)](logo.svg)

Articulate addresses these pains with context-bounded entities and scoped unit-of-work management.

Badges
------

[](#badges)

[![CI](https://github.com/DenisYu-1/articulate/workflows/QA/badge.svg)](https://github.com/DenisYu-1/articulate/actions)[![Mutation testing](https://camo.githubusercontent.com/37d607e74f439d9bcec663807b7ea28739ed572fc2b4ed20d8898c45d0bea326/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d75746174696f6e25323053636f72652d38332532352b2d627269676874677265656e)](https://github.com/DenisYu-1/articulate/actions)[![PHP Version](https://camo.githubusercontent.com/6e44ad49e5307c87d1393389feb52ab61c99956e2e5f8c77177b2501f1d3d47f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e342d3838393242462e737667)](https://php.net/)

Quick Start
-----------

[](#quick-start)

```
use Articulate\Connection;
use Articulate\Modules\EntityManager\EntityManager;

#[Entity]
class User
{
    #[PrimaryKey]
    public ?int $id = null;

    #[Property]
    public string $name;

    #[Property]
    public string $email;
}

$connection = new Connection('mysql:host=127.0.0.1;dbname=myapp', 'user', 'password');
$em = new EntityManager($connection);

$user = new User();
$user->name = 'Jane';
$user->email = 'jane@example.com';
$em->persist($user);
$em->flush();

$user = $em->getRepository(User::class)->find($user->id);
```

Before / After
--------------

[](#before--after)

**Before** — one fat entity, every context gets everything:

```
#[Entity]
class User
{
    public int $id;
    public string $login;
    public string $password;
    public string $name;
    public array $phones;   // Auth doesn't need this
    public array $groups;  // Auth doesn't need this
    public Cart $cart;     // Auth doesn't need this
}

// Auth: loads full user + all relations
$user = $userRepo->find($id);
return $auth->validate($user->login, $user->password);
```

**After** — separate entities per context, same table:

```
#[Entity(tableName: 'user')]
class LoginUser
{
    #[PrimaryKey]
    public int $id;

    #[Property]
    public string $login;

    #[Property]
    public string $password;
}

#[Entity]
class User
{
    #[PrimaryKey]
    public int $id;

    #[Property]
    public string $name;

    #[OneToMany(ownedBy: 'user', targetEntity: Phone::class)]
    public array $phones;

    #[OneToOne(targetEntity: Cart::class, referencedBy: 'user')]
    public Cart $cart;
}

// Auth: loads only id, login, password
$loginUser = $em->getRepository(LoginUser::class)->find($id);
return $auth->validate($loginUser->login, $loginUser->password);
```

How Articulate Compares?
------------------------

[](#how-articulate-compares)

DoctrineCycle ORMArticulateMultiple entity classes per tableNo built-in supportNo, one entity per tableYes, first-class context-bounded entitiesMemory controlIdentity map held for process lifetime; clear-all or nothingSimilar modelScoped unit-of-work; release entities mid-requestConfig styleXML/YAML common, attributes optionalAnnotations/attributesAttributes only (PHP 8.4+)Articulate is aimed at projects where different bounded contexts need different views of the same data and where memory pressure matters in long-running or batch processes.

Core Concepts
-------------

[](#core-concepts)

### Context-Bounded Entities

[](#context-bounded-entities)

Multiple entity classes can point to the same database table, each exposing only the fields and relationships needed for that context. Articulate merges compatible column definitions and validates for conflicts.

### Memory-Efficient Unit of Work

[](#memory-efficient-unit-of-work)

- Clear entities from memory that are no longer needed within specific operations
- Different units of work can track their own entities independently
- Entity manager combines all unit-of-work changes into minimal database queries during flush

Useful for processing large datasets, complex business operations spanning multiple contexts, and long-running processes with varying entity lifecycles.

Type Mapping System
-------------------

[](#type-mapping-system)

Built-in mappings: `bool` ↔ `TINYINT(1)`, `int` ↔ `INT`, `float` ↔ `FLOAT`, `string` ↔ `VARCHAR(255)`, `DateTimeInterface` ↔ `DATETIME`.

Custom class mappings and `TypeConverterInterface` for complex types. Priority-based resolution when a class implements multiple interfaces with registered mappings.

Repository Pattern
------------------

[](#repository-pattern)

```
$userRepo = $em->getRepository(User::class);
$user = $userRepo->find(1);
$users = $userRepo->findBy(['status' => 'active']);
$user = $userRepo->findOneBy(['email' => 'user@example.com']);
```

Custom repositories via `#[Entity(repositoryClass: UserRepository::class)]` extending `AbstractRepository`.

License
-------

[](#license)

Licensed under the Apache License 2.0. See [LICENSE](./LICENSE).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance69

Regular maintenance activity

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.8% 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 ~1 days

Total

2

Last Release

71d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e472490074fc76610d3a153c50e8c4997f0b115ccdf841e56e4f5f6eecde8855?d=identicon)[DenisYu-1](/maintainers/DenisYu-1)

---

Top Contributors

[![denis-yuriev-1](https://avatars.githubusercontent.com/u/113170771?v=4)](https://github.com/denis-yuriev-1 "denis-yuriev-1 (47 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (16 commits)")[![DenisYu-1](https://avatars.githubusercontent.com/u/230987271?v=4)](https://github.com/DenisYu-1 "DenisYu-1 (16 commits)")[![V-Srv](https://avatars.githubusercontent.com/u/7782973?v=4)](https://github.com/V-Srv "V-Srv (1 commits)")

---

Tags

phpdatabaseormdddentity-managerbounded-context

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/denisyu-1-articulate/health.svg)

```
[![Health](https://phpackages.com/badges/denisyu-1-articulate/health.svg)](https://phpackages.com/packages/denisyu-1-articulate)
```

###  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)[nettrine/orm

Doctrine ORM for Nette Framework

581.9M37](/packages/nettrine-orm)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

203.7k](/packages/perplorm-perpl)[bartlett/php-compatinfo-db

Reference Database of all functions, constants, classes, interfaces on PHP standard distribution and about 110 extensions

1183.0k1](/packages/bartlett-php-compatinfo-db)[modul-is/orm

Lightweight hybrid ORM/Explorer

1118.1k](/packages/modul-is-orm)

PHPackages © 2026

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