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
Requires
- php: ^8.5
- coolms/core: ^1.0
- coolms/rql: ^1.0
- coolms/rql-doctrine: ^1.0
- doctrine/dbal: ^4.0
- doctrine/doctrine-bundle: ^3.2
- doctrine/orm: ^3.0
- doctrine/persistence: ^4.0
- psr/clock: ^1.0
- psr/log: ^3.0
- symfony/clock: ^8.0
- symfony/dependency-injection: ^8.0
- symfony/event-dispatcher-contracts: ^3.4.2
- symfony/http-kernel: ^8.0
- symfony/uid: ^8.0
Requires (Dev)
- phpunit/phpunit: ^12.5
Provides
This package is auto-updated.
Last update: 2026-08-17 19:54:11 UTC
README
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\Corewithout a matching.orm.xmlis 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\OutboxRecord→Outbox.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.