entityManager->getRepository(ContentSource::class)->find($id); if (!$source) { throw new SourceNotFoundException("Source not found"); } return new Source( id: new SourceId($source->getId()), name: $source->getCleanBaseUrl(), description: 'Legacy Source: ' . $source->getBaseUrl(), baseUrl: $source->getBaseUrl(), scrappingParameters: [ 'imageSelector' => $source->getImageSelector(), 'nextPageSelector' => $source->getNextPageSelector(), 'chapterUrlFormat' => $source->getChapterUrlFormat(), 'scrapingType' => $source->getScrapingType(), 'chapterSelector' => $source->getChapterSelector() ], isActive: true, createdAt: new DateTimeImmutable(), updatedAt: new DateTimeImmutable() ); } }