PHPackages                             mgamadeus/ddd - 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. mgamadeus/ddd

ActiveLibrary[Framework](/categories/framework)

mgamadeus/ddd
=============

A DDD Entity Framework on top of symfony and doctrine

2.51.2(3w ago)36.5k↑23.8%6MITPHPPHP &gt;=8.3

Since Feb 26Pushed 2mo ago7 watchersCompare

[ Source](https://github.com/mgamadeus/ddd)[ Packagist](https://packagist.org/packages/mgamadeus/ddd)[ RSS](/packages/mgamadeus-ddd/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (348)Versions (413)Used By (6)

mgamadeus/ddd
=============

[](#mgamadeusddd)

A Domain-Driven Design entity framework built on top of Symfony 7.3 and Doctrine ORM for PHP 8.3+.

Overview
--------

[](#overview)

`mgamadeus/ddd` provides a complete DDD stack for building PHP applications:

- **Entities &amp; Value Objects** with identity, validation, serialization, parent-child relationships, and single table inheritance
- **Lazy Loading** via `#[LazyLoad]` attributes -- relationships load on-demand from DB, Virtual, or Class Method repositories
- **Repository Pattern** with DB (Doctrine), Virtual, and Class Method repository types, plus auto-generated ORM model classes
- **Service Layer** with `EntitiesService` for entity management and `Service` for cross-cutting concerns
- **OData-Style QueryOptions** -- `$filter`, `$select`, `$expand`, `$orderBy`, `$top`, `$skip` with 11 filter operators (eq, ne, gt, ge, lt, le, in, ni, bw, ft, fb)
- **Rights Protection** -- query-level access control via `applyReadRightsQuery()`, `applyUpdateRightsQuery()`, `applyDeleteRightsQuery()`
- **Multi-Language Support** via `#[Translatable]` with JSON storage, fulltext search indexes, and language/country/writing-style context
- **Change History** -- automatic `created`/`updated` timestamps via `ChangeHistoryTrait`
- **REST Presentation Layer** -- `HttpController`, typed DTOs (Request/Response), OpenAPI 3.0 documentation, request caching, specialized response types (Excel, PDF, ZIP, Image, HTML, Redirect)
- **Async Processing** -- Symfony Messenger integration with `AppMessage`/`AppMessageHandler` base classes, auth context propagation, and workspace routing
- **Module System** -- Composer packages self-register as DDD modules with automatic service discovery and entity inclusion
- **CLI Commands** -- Console command infrastructure with admin auth context, batch processing, progress tracking, and cron job management
- **Infrastructure Utilities** -- Config management, caching (APC/Redis/PhpFiles), encryption, JWT, text processing, input filtering, internationalized domain names

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Symfony 7.3
- Doctrine ORM ^2.13
- Extensions: `ctype`, `dom`, `gd`, `iconv`, `libxml`, `openssl`, `zlib`, `imagick`

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

[](#installation)

```
composer require mgamadeus/ddd
```

Register the bundle in your Symfony application:

```
// config/bundles.php
return [
    // ...
    DDD\DDDBundle::class => ['all' => true],
];
```

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

[](#quick-start)

### 1. Entity

[](#1-entity)

```
