php-ddd
php-ddd copied to clipboard
PHP Symfony Doctrine Domain-driven Design
Given is an event-sourced `EmploymentContract` holding an `EmploymentPeriod` with a start and end date. It is then possible to "deploy employees of a contract to other work places". *But the...
When I started decoupling from Symfony Form and the `EntityType` I switched to primitive types only that would then be used on the `data_class` which is the Command / DTO....
I have an `Inspection` Domain Model with a lot of properties, some of them nested. A new Inspection is handled by a Command Handler. The Inspection AR then raises an...
Code examples: * https://gist.github.com/webdevilopers/160409917c942e0ba83ba948250aec18 Doctrine MongoDB offers a Default GridFS Repository to upload files and map them to a MongoDB Document. This document has default fields e.g. "uploadDate" that get...
Symfony 4/5 create an `App` namespace by default refering to alle files inside the `src` folder. Initially a `Controller` folder may be created. When adding the `doctrine` recipe it will...
For naming conventions please see: - https://github.com/dddinphp/ddd-in-php-book-issues/issues/51 Injecting `EntityManager` only and the `Law of Demeter`: - https://github.com/dddinphp/repository-examples/blob/master/src/Infrastructure/Persistence/Doctrine/DoctrinePostRepository.php#L12-17 - https://disqus.com/home/discussion/adamquaile/composition_over_inheritance_in_doctrine_repositories_72/#comment-2703359347 @adamquaile Extend the Doctrine EntityRepository as suggested by @MacDada? - https://gist.github.com/MacDada/025ef645837363fef0ec1ea0a2ead6fb...
Came from: * https://twitter.com/webdevilopers/status/1204375222343720960 Recently I started a symfony project w/ @prooph components. Looking at the bluebrints I recognized the creation of events has changed. ```php class User extends AggregateRoot...
When deserializing messages (e.g. Domain Events inside the same context) that hold value objects, do you still validate the given data or do you simply trust the incoming data? Currently...
My original post and poll started here: https://twitter.com/webdevilopers/status/1100102866583339008 This was the original gist: * https://gist.github.com/webdevilopers/fa3bbfbb8e2b36a4a4619217e6469fdc Use case: I need to calculate a `Dormer` based on specific `DormerType` (Entity). Business rule:...
If anywhere in your application e.g. in your Handler or `DomainModel` an Exception / `DomainException` is thrown you can catch and convert the message to use it in your Symfony...