est mi se à pink LA MODIFICA TI ON La voiture a été peinte en pink UPDA TE cars S E T color = "pink" WHERE car_id = "1234"; INSERT INTO events S ET event_name = "car_painted", event_data = '{ "color": "pink" }';
RING car AGGREGA TE _ID UUID d3b0e026-2940-4093-9580-6da0d1854e71 AGGREGA TE _VERSION INT 13 DAT ETIME T IME 29/03/2024 14:00:00 DATA JSON { "color": "pink" } 67b2262a-8a14-43 f0 -884f-6 0 7 2784fd272 ID UUID CON TE XT JSON { "user": "5678", "request": "ABCD" }
{ public function store(Event ... $ events): void { foreach ( $ events as $event) { $ t his->doctrineConnection->insert( 'events', $ t his->serializer->serialize( $ event), ); } $t his->eventBus->dispatch( $ events); } } Event st or e 48
CommandBus im plements CommandBusInterface { use HandleTrait; public function __construct( M essageBusInterface $messageBus) { $ t his->messageBus = $messageBus; } public function dispatch(object $command): void { $ t his->handle( $ command); } } Command bus 57
f ony\Component\Scheduler\RecurringMessage; use Sy m f ony\Component\Scheduler\Schedule; use Sy m f ony\Component\Scheduler\ScheduleProviderInterface; # [AsSchedule(name: 'car')] class EndO f W eekProvider i m plements ScheduleProviderInterface { public function getSchedule(): Schedule { return (new Schedule())->add( RecurringMessage::every( 'first day of week m i dnight', new DispatchEndO fW eek() )); } }
final public function __construct(public string $v alue) { // do validation about the value } final public static function create(): static { return new static((new Ulid())->toBase32()); } } Id 66
final class PaintCarAction { public function __invoke( string $i d, # [ M apRequestPayload] PaintCarInput $paintCarInput, CommandBusInterface $commandBus, ): Response { $commandBus->dispatch(new PaintCar( new CarId( $i d), $gradeAnswerInput->color, )); return new Response(status: Response::HTTP_ACCEP TE D); } } User interface 84
you see no image in this page, you may need to configure your web server so that it gains access to the sy mf ony_data/web/sf/ directory. This is a temporary page This page is part of the symfony default module. It will disappear as soon as you define a homepage route in your routing.y ml . What’s next Create your data model Customize the layout of the generated templates Learn more from the online documentation Symfony Project Created Congratulations! You have successfully created your symfony project.