Skip to content

Commit

Permalink
Merge pull request #5 from RRZE-Webteam/FAU-420
Browse files Browse the repository at this point in the history
[FAU-420] Add new "German language skills for international students" filter and allow sorting by it
  • Loading branch information
amiut authored May 10, 2024
2 parents b75b9ed + c3bcb84 commit 58c96a8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Application/Filter/FilterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
final class FilterFactory
{
public const SUPPORTED_FILTERS = [
AdmissionRequirementTypeFilter::KEY => AdmissionRequirementTypeFilter::class,
AreaOfStudyFilter::KEY => AreaOfStudyFilter::class,
AttributeFilter::KEY => AttributeFilter::class,
DegreeFilter::KEY => DegreeFilter::class,
FacultyFilter::KEY => FacultyFilter::class,
GermanLanguageSkillsForInternationalStudentsFilter::KEY => GermanLanguageSkillsForInternationalStudentsFilter::class,
SearchKeywordFilter::KEY => SearchKeywordFilter::class,
SemesterFilter::KEY => SemesterFilter::class,
StudyLocationFilter::KEY => StudyLocationFilter::class,
SubjectGroupFilter::KEY => SubjectGroupFilter::class,
TeachingLanguageFilter::KEY => TeachingLanguageFilter::class,
AdmissionRequirementTypeFilter::KEY => AdmissionRequirementTypeFilter::class,
];

public function create(string $filterName, mixed $value): ?Filter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Fau\DegreeProgram\Common\Application\Filter;

final class GermanLanguageSkillsForInternationalStudentsFilter implements Filter
{
use ArrayOfIdsFilterTrait;

public const KEY = 'german-language-skills-for-international-students';

public function id(): string
{
return self::KEY;
}
}
1 change: 1 addition & 0 deletions src/Application/Repository/CollectionCriteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ final class CollectionCriteria
DegreeProgram::START,
DegreeProgram::LOCATION,
DegreeProgram::ADMISSION_REQUIREMENTS,
DegreeProgram::GERMAN_LANGUAGE_SKILLS_FOR_INTERNATIONAL_STUDENTS,
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

namespace Fau\DegreeProgram\Common\Infrastructure\Content\Taxonomy;

use Fau\DegreeProgram\Common\Application\Filter\GermanLanguageSkillsForInternationalStudentsFilter;

/**
* Deutschkenntnisse für ausländische Studierende
*/
final class GermanLanguageSkillsForInternationalStudentsTaxonomy extends Taxonomy
{
public const KEY = 'german_for_int_students';
public const REST_BASE = 'german-language-skills-for-international-students';
public const REST_BASE = GermanLanguageSkillsForInternationalStudentsFilter::KEY;

public function key(): string
{
Expand Down
2 changes: 2 additions & 0 deletions src/Infrastructure/Repository/WpQueryArgsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Fau\DegreeProgram\Common\Application\Filter\DegreeFilter;
use Fau\DegreeProgram\Common\Application\Filter\FacultyFilter;
use Fau\DegreeProgram\Common\Application\Filter\Filter;
use Fau\DegreeProgram\Common\Application\Filter\GermanLanguageSkillsForInternationalStudentsFilter;
use Fau\DegreeProgram\Common\Application\Filter\SearchKeywordFilter;
use Fau\DegreeProgram\Common\Application\Filter\SemesterFilter;
use Fau\DegreeProgram\Common\Application\Filter\StudyLocationFilter;
Expand Down Expand Up @@ -40,6 +41,7 @@ final class WpQueryArgsBuilder
StudyLocationFilter::class,
SubjectGroupFilter::class,
TeachingLanguageFilter::class,
GermanLanguageSkillsForInternationalStudentsFilter::class,
];

private const ALIASES = [
Expand Down

0 comments on commit 58c96a8

Please sign in to comment.