registry = $registry; } /** * @param SubjectData[] $subjectData * @return SubjectEntry>[] */ public function getSubjectsEntries(array $subjectData): array { $subjectEntries = []; foreach ($subjectData as $data) { $subjectEntries[] = $this->getSubjectEntry($data); } return $subjectEntries; } /** * @param SubjectData $subjectData * @return SubjectEntry> */ public function getSubjectEntry(SubjectData $subjectData): SubjectEntry { $key = $subjectData->getKey(); $subject = $this->registry->getSubject($key); if (!$subject) { throw Exceptions::subjectNotFound($key); } return new SubjectEntry($subject, $subjectData); } }