diff --git a/src/Infrastructure/Repository/BilingualRepository.php b/src/Infrastructure/Repository/BilingualRepository.php index e899ef4..cd6aa76 100644 --- a/src/Infrastructure/Repository/BilingualRepository.php +++ b/src/Infrastructure/Repository/BilingualRepository.php @@ -125,16 +125,16 @@ final protected function bilingualOption(string $key): MultilingualString ); } - final protected function bilingualLinkFromTerm(?WP_Term $term, string $taxonomy): MultilingualLink + final protected function bilingualLinkFromTerm(?WP_Term $term): MultilingualLink { - $parentTerm = $term instanceof WP_Term && $term->parent ? get_term($term->parent, $taxonomy) : null; + $parentTerm = $term instanceof WP_Term && $term->parent ? get_term($term->parent, $term->taxonomy) : null; return MultilingualLink::new( $term instanceof WP_Term ? $this->idGenerator->generateTermId($term) : '', name: $this->bilingualTermName($term), linkText: $this->bilingualTermMeta($term, MultilingualLink::LINK_TEXT), linkUrl: $this->bilingualTermMeta($term, MultilingualLink::LINK_URL), - parent: $parentTerm instanceof WP_Term ? $this->bilingualLinkFromTerm($parentTerm, $taxonomy) : null, + parent: $parentTerm instanceof WP_Term ? $this->bilingualLinkFromTerm($parentTerm) : null, ); } @@ -147,7 +147,7 @@ final protected function bilingualTermLinks(WP_Post $post, string $taxonomy): Mu $links = []; foreach ($terms as $term) { - $links[] = $this->bilingualLinkFromTerm($term, $taxonomy); + $links[] = $this->bilingualLinkFromTerm($term); } return MultilingualLinks::new(...$links); diff --git a/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramRepository.php b/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramRepository.php index a18f6b2..01c4a65 100644 --- a/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramRepository.php +++ b/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramRepository.php @@ -146,21 +146,18 @@ public function getById(DegreeProgramId $degreeProgramId): DegreeProgram $post, BachelorOrTeachingDegreeAdmissionRequirementTaxonomy::KEY, ), - BachelorOrTeachingDegreeAdmissionRequirementTaxonomy::KEY, ), teachingDegreeHigherSemester: $this->admissionRequirement( $this->firstTerm( $post, TeachingDegreeHigherSemesterAdmissionRequirementTaxonomy::KEY, ), - TeachingDegreeHigherSemesterAdmissionRequirementTaxonomy::KEY, ), master: $this->admissionRequirement( $this->firstTerm( $post, MasterDegreeAdmissionRequirementTaxonomy::KEY, ), - MasterDegreeAdmissionRequirementTaxonomy::KEY, ), ), contentRelatedMasterRequirements: $this->bilingualPostMeta( @@ -189,13 +186,11 @@ public function getById(DegreeProgramId $degreeProgramId): DegreeProgram $post, GermanLanguageSkillsForInternationalStudentsTaxonomy::KEY, ), - GermanLanguageSkillsForInternationalStudentsTaxonomy::KEY, ), startOfSemester: $this->bilingualLinkFromOption(DegreeProgram::START_OF_SEMESTER), semesterDates: $this->bilingualLinkFromOption(DegreeProgram::SEMESTER_DATES), examinationsOffice: $this->bilingualLinkFromTerm( $this->firstTerm($post, ExaminationsOfficeTaxonomy::KEY), - ExaminationsOfficeTaxonomy::KEY, ), examinationRegulations: (string) get_post_meta( $postId, @@ -212,7 +207,6 @@ public function getById(DegreeProgramId $degreeProgramId): DegreeProgram studentAdvice: $this->bilingualLinkFromOption(DegreeProgram::STUDENT_ADVICE), subjectSpecificAdvice: $this->bilingualLinkFromTerm( $this->firstTerm($post, SubjectSpecificAdviceTaxonomy::KEY), - SubjectSpecificAdviceTaxonomy::KEY, ), serviceCenters: $this->bilingualLinkFromOption(DegreeProgram::SERVICE_CENTERS), infoBrochure: (string) get_post_meta( @@ -241,7 +235,6 @@ public function getById(DegreeProgramId $degreeProgramId): DegreeProgram ), applyNowLink: $this->bilingualLinkFromTerm( $this->firstTerm($post, ApplyNowLinkTaxonomy::KEY), - ApplyNowLinkTaxonomy::KEY, ), combinations: $this->idsFromPostMeta($postId, DegreeProgram::COMBINATIONS), limitedCombinations: $this->idsFromPostMeta( @@ -303,7 +296,7 @@ private function degreeFromTerm(WP_Term $term): Degree ); } - private function admissionRequirement(?WP_Term $term, string $taxonomy): AdmissionRequirement + private function admissionRequirement(?WP_Term $term): AdmissionRequirement { if (!$term instanceof WP_Term) { return AdmissionRequirement::empty(); @@ -312,8 +305,8 @@ private function admissionRequirement(?WP_Term $term, string $taxonomy): Admissi $parent = $term->parent ? get_term($term->parent) : null; return AdmissionRequirement::new( - $this->bilingualLinkFromTerm($term, $taxonomy), - $parent instanceof WP_Term ? $this->admissionRequirement($parent, $taxonomy) : null, + $this->bilingualLinkFromTerm($term), + $parent instanceof WP_Term ? $this->admissionRequirement($parent) : null, $term->slug ); }