PHPackages                             antonyan/ddd-mappers-infrastructure - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. antonyan/ddd-mappers-infrastructure

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antonyan/ddd-mappers-infrastructure
===================================

DDD project infrastructure

v4.1.2(3y ago)91.2k1[1 issues](https://github.com/Antonyan/ddd-mappers-infrastructure/issues)1MITPHPPHP &gt;=7.1.0CI failing

Since Aug 28Pushed 3y ago7 watchersCompare

[ Source](https://github.com/Antonyan/ddd-mappers-infrastructure)[ Packagist](https://packagist.org/packages/antonyan/ddd-mappers-infrastructure)[ RSS](/packages/antonyan-ddd-mappers-infrastructure/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (16)Versions (68)Used By (1)

ddd-mappers-infrastructure
==========================

[](#ddd-mappers-infrastructure)

Infrastructure layer for [DDD project](https://github.com/Antonyan/ddd-mappers-project) based on Data Mapper as Data source pattern [Data Mapper](https://martinfowler.com/eaaCatalog/dataMapper.html)

General
-------

[](#general)

In case if you use this layer with [DDD project](https://github.com/Antonyan/ddd-mappers-project) all functionality will be plugged automatically. An entry point is an Application class. Which uses Symfony HttpKernel as an engine.

#### Main flow

[](#main-flow)

1. An application gets a controller (Service of the presentation layer) and method from a request.
2. Dispatch event for request preprocessing: filtering, validation etc.
3. Call controller.

#### Dependency management

[](#dependency-management)

The architecture of the current application implies that main business logic will place in services. Each module and context will have representative service. Service extends BaseService which get a container (Dependency Injection) and config from "config" folder at the level above. On top of that container for each Service is automatically merged with infrastructure container.

#### Infrastructure container

[](#infrastructure-container)

Infrastructure container includes **db** connection, **MySqlClient**, **RequestFactory**, **HttpClient**.

DB interaction
--------------

[](#db-interaction)

#### Connection

[](#connection)

If you're using MySQL as DB you should specify DDD\_RBD\_NAME, DDD\_RBD\_USER, DDD\_RBD\_PASSWORD, DDD\_RBD\_HOST, DDD\_RBD\_DRIVER (pdo\_mysql) as env variables or just in .env file of the [DDD project](https://github.com/Antonyan/ddd-mappers-project)

#### DbMapper

[](#dbmapper)

For [Rapid application development (RAD)](https://en.wikipedia.org/wiki/Rapid_application_development) we were created such abstraction as DbMapper. If you need CRUD implementation only it'll be supported out of the box. All that you need is to specify table and fields mapping in Module config. For create and update you should specify identifiers names. Config example:

```
'DeliveryDbTranslator' => [
        'table' => 'deliveries',
        'columns' => [
			'id' => 'deliveries.id',
			'deliveryCostId' => 'deliveries.deliveryCostId',
			'orderId' => 'deliveries.orderId',
			'status' => 'deliveries.status',
			'deliveryTime' => 'deliveries.deliveryTime',
			'locationId' => 'deliveries.locationId',
			'deliveryPhone' => 'deliveries.deliveryPhone',
			'contactPerson' => 'deliveries.contactPerson',
			'notice' => 'deliveries.notice',
        ],
        'create' => 'id',
        'update' => ['id'],
    ],

```

Http interaction
----------------

[](#http-interaction)

#### HttpMapper

[](#httpmapper)

If the resource that you need you should get from another service (by HTTP(s)) you can use HTTP mapper which interface is similar to DbMapper. Config example:

```
return [
    'httpConfig' => [
        'availableUrls' => [
            'get' => getenv('SOME_MICROSERVICE_BASE_URL').'/users/:id',
        ]
    ],
];

```

Logging
-------

[](#logging)

For logging purpose we're using [Monolog](https://github.com/Seldaek/monolog), but of course, we encapsulated it to rid of dependencies. We support logging to the file and to the [CloudWatch](https://aws.amazon.com/cloudwatch/). To use logging you should create Service (example):

```
class SomeLogger extends LogService
{
    /**
     * @return string
     */
    protected function getChannelName(): string
    {
        return "specific-channel-name";
    }

}

```

On top of that, you should specify env variable with log destination LOGGING\_TYPE = file or LOGGING\_TYPE = cloudWatch

Customize your services
-----------------------

[](#customize-your-services)

- `application.error.handler`is reserved service to override to handle api fail response on exception

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity72

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

Recently: every ~308 days

Total

65

Last Release

1362d ago

Major Versions

v1.7.5 → v2.02018-11-09

v2.11 → v3.0.02019-02-21

v3.5.1 → v4.02019-05-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33348303?v=4)[Artem](/maintainers/maggadda)[@maggadda](https://github.com/maggadda)

---

Top Contributors

[![phpadventure](https://avatars.githubusercontent.com/u/17879265?v=4)](https://github.com/phpadventure "phpadventure (51 commits)")[![sbobrov-xlntech](https://avatars.githubusercontent.com/u/42774638?v=4)](https://github.com/sbobrov-xlntech "sbobrov-xlntech (51 commits)")[![Antonyan](https://avatars.githubusercontent.com/u/3841665?v=4)](https://github.com/Antonyan "Antonyan (50 commits)")[![denysov-serhii](https://avatars.githubusercontent.com/u/9298988?v=4)](https://github.com/denysov-serhii "denysov-serhii (16 commits)")[![romaBabyak](https://avatars.githubusercontent.com/u/8015351?v=4)](https://github.com/romaBabyak "romaBabyak (13 commits)")[![petr-saganov-cloudbeds](https://avatars.githubusercontent.com/u/107559386?v=4)](https://github.com/petr-saganov-cloudbeds "petr-saganov-cloudbeds (1 commits)")[![saganov](https://avatars.githubusercontent.com/u/717117?v=4)](https://github.com/saganov "saganov (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/antonyan-ddd-mappers-infrastructure/health.svg)

```
[![Health](https://phpackages.com/badges/antonyan-ddd-mappers-infrastructure/health.svg)](https://phpackages.com/packages/antonyan-ddd-mappers-infrastructure)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k55](/packages/open-dxp-opendxp)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M464](/packages/pimcore-pimcore)

PHPackages © 2026

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