Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FAU-420] Add new "German language skills for international students" filter and allow sorting by it #5

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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