protected function onAggregateRootCreated(AggregateRootCreatedEvent $event) { $projection_data = $event->getData(); $projection_data['identifier'] = $event->getAggregateRootIdentifier(); $projection_data['revision'] = $event->getSeqNumber(); $projection_data['created_at'] = $event->getDateTime(); $projection_data['modified_at'] = $event->getDateTime(); $projection_data['metadata'] = $event->getMetaData(); $projection_type = $this->getProjectionType($event); if ($projection_type->isHierarchical()) { $parent_projection = null; if (isset($projection_data['parent_node_id'])) { $parent_projection = $this->loadProjection($event, $projection_data['parent_node_id']); } $projection_data['materialized_path'] = $this->calculateMaterializedPath($parent_projection); } $new_projection = $projection_type->createEntity($projection_data); $this->handleEmbeddedEntityEvents($new_projection, $event->getEmbeddedEntityEvents()); return new ProjectionMap([$new_projection]); }
protected function onAggregateRootCreated(AggregateRootCreatedEvent $event) { $ar_type = $this->aggregate_root_type_map->getItem($event->getAggregateRootType()); $this->moveTempFilesToFinalLocation($event, $ar_type); }