Download the PHP package somnambulist/domain without Composer
On this page you can find all versions of the php package somnambulist/domain. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download somnambulist/domain
More information about somnambulist/domain
Files in somnambulist/domain
Package domain
Short Description Provides a collection of entities, helpers and base implementations for creating domain objects.
License MIT
Informations about the package domain
Somnambulist Domain Package
Provides a core set of support classes for building domain oriented projects. This library compiles the previously separate domain and mapping libraries into a single project for easier maintenance.
It consists of:
- Commands
- CommandBus interface / abstract command
- SF Messenger implementation
- Doctrine
- Enumeration factories + Type bindings
- Additional types / type overrides for the Doctrine Type system
- Abstract EntityLocator that extends EntityRepository
- Custom Postgres DQL functions
- Custom traits for EntityRepository
- Models
- Contracts - value object interface definitions
- Types - a collection of value-objects, enumerations, and date helpers
- AggregateRoot - an aggregate root stub implementation that can raise events
- AbstractEntity and AbstractEntityCollection - child entities and helper for an aggregate root
- Events
- EventBus interface / abstract event
- SF Messenger EventBus implementation
- Doctrine subscriber that broadcasts onFlush all events from aggregate roots
- Custom serializer to handle encode/decode when the event class does not exist
- Jobs
- JobQueue interface / abstract job
- SF Messenger implementation
- Queries
- QueryBus interface / abstract query
- SF Messenger implementation
- default XML mappings for embeddable objects in Doctrine .dcm.xml and Symfony .orm.xml conventions
Requirements
- PHP 8.1+
- mb_string
- bcmath
- beberlei/assert
- eloquent/enumeration
- somnambulist/collection
- symfony/messenger for the Messenger bus implementations.
Installation
Install using composer, or checkout / pull the files from github.com.
- composer require somnambulist/domain
Upgrading from 4.X to 5.X
From 5.X this project will be re-namespaced to drop Domain
. 4.X includes a classmap.php
providing
aliases for backwards compatibility.
From 5.0 the QueryBus supports typed response objects. This is an optional feature that provides a built-in mechanism to handle failed queries without trapping exceptions in the calling code.
From 5.0 domain event names are always generated at construction time as snake_case
.
Upgrading from 3.X to 4.X
From 4.X this project was re-namespaced to Somnambulist\Components\Domain
. Update all references to
reflect this change this includes any Doctrine mapping files / annotations.
The Doctrine AbstractIdentityType
was moved out of the Identity
namespace to the main Types
.
Usage
See the docs folder for more documentation on each component.
- Aggregate Root
- Domain Events
- Value Objects
- Enumerations
- Enumeration Bridge
- Doctrine Mapping
- Symfony Messenger Integration
- Using Command Query Separation
Links
All versions of domain with dependencies
ext-bcmath Version *
ext-json Version *
ext-mbstring Version *
beberlei/assert Version ^3.3
pragmarx/ia-str Version ^7.3
ramsey/uuid Version ^4.7
somnambulist/collection Version ^5.3
somnambulist/enumeration Version ^1.0