coolms/core-doctrine

Doctrine ORM/DBAL adapters for coolms/core: outbox and inbox stores, the sync change feed, config overrides, range column types and the RQL-aware base repository

Maintainers

Package info

github.com/coolms/core-doctrine

pkg:composer/coolms/core-doctrine

Transparency log

Statistics

Installs: 10

Dependents: 2

Suggesters: 1

Stars: 0

Open Issues: 1

v1.0.1 2026-08-17 17:59 UTC

This package is auto-updated.

Last update: 2026-08-17 19:54:11 UTC


README

CI Latest Version PHP License

The Doctrine ORM/DBAL adapter for coolms/core. Everywhere the platform commits to Doctrine, in one package.

"provide": { "coolms/core-persistence-implementation": "1.0" }

That line is the point. coolms/core-module requires the virtual package, this one provides it, and an alternative adapter substitutes by providing the same thing. Nothing upstream names a Doctrine class.

Installation

composer require coolms/core-doctrine

Then register the bundle:

// config/bundles.php
CoolMS\Core\Doctrine\CoreDoctrineBundle::class => ['all' => true],

That is the whole integration. The bundle prepends its own Doctrine config, so no edit to your doctrine.yaml is required.

What you get

Registering the bundle binds the kernel's persistence contracts:

Contract (coolms/core) Implementation
TransactionRunnerInterface DoctrineTransactionRunner
OutboxAppenderInterface PersistingOutboxAppender
OutboxRelayRepositoryInterface DbalOutboxRelayRepository
ProcessedMessageStoreInterface DbalProcessedMessageStore
ConfigOverrideRepositoryInterface ConfigOverrideRepository

Plus three custom DBAL column types — date_range, datetime_range, time_range — and the ORM mapping for Core's four persisted rows.

Why the mapping is XML

The entity classes ship in coolms/core, which must not import the ORM. So the mapping lives here and travels with the adapter:

'is_bundle' => false,
'type'      => 'xml',
'dir'       => '%kernel.project_dir%/vendor/coolms/core-doctrine/src/mapping',
'prefix'    => 'CoolMS\\Core',

The driver owns that whole namespace. A new entity added under CoolMS\Core without a matching .orm.xml is simply not mapped, and nothing reports it — the class just never becomes an entity. Add the mapping file at the same time as the class. The file name is the class name minus the prefix, dots for separators: CoolMS\Core\Outbox\OutboxRecordOutbox.OutboxRecord.orm.xml.

The RQL-aware base repository

DoctrineRepository gives you findByRql(), plus save()/delete() honouring the platform's deferred-flush transaction mode. It is typed against coolms/core's RepositoryInterface, so consumers depend on the contract.

Writing another adapter

Provide the virtual package, bind the same contracts, ship your own mapping:

"provide": { "coolms/core-persistence-implementation": "1.0" }

Swapping is then one line in config/bundles.php plus the Composer require.

License

MIT. See LICENSE.