mangas = $mangas; } public function search(string $title): MangaCollection { $results = array_filter( $this->mangas, fn (Manga $manga) => str_contains( strtolower($manga->getTitle()->getValue()), strtolower($title) ) ); return new MangaCollection($results); } public function findByExternalId(ExternalId $externalId): ?Manga { foreach ($this->mangas as $manga) { if ($manga->getExternalId() && $manga->getExternalId()->getValue() === $externalId->getValue()) { return $manga; } } return null; } }