-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDocumentCategory.php
54 lines (47 loc) · 1.68 KB
/
DocumentCategory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace App\Models;
enum DocumentCategory: string
{
case AppfOriginal = 'appf-original';
case AppfCopy = 'appf-copy';
case InsurancePolice = 'insurance';
case Motivation = 'motivation';
case PassportCopy = 'passport';
case Picture = 'picture';
case ResidencePermit = 'residence-permit';
case Rules = 'rules';
case SchoolCertificate = 'school-certificate';
case Unknown = 'unknown';
public static function read(?string $value): DocumentCategory
{
if ($value == null) {
return DocumentCategory::Unknown;
}
return DocumentCategory::from($value);
}
/**
* @return DocumentCategory[]
*/
public static function validCategories(): array
{
return [
self::AppfOriginal, self::AppfCopy, self::InsurancePolice, self::Motivation, self::PassportCopy,
self::Picture, self::ResidencePermit, self::Rules, self::SchoolCertificate,
];
}
public function displayName(): string
{
return strval(match ($this) {
self::Rules => __('registration.rules'),
self::InsurancePolice => __('registration.insurance-policy'),
self::Motivation => __('registration.motivation'),
self::PassportCopy => __('registration.passport-copy'),
self::Picture => __('registration.picture'),
self::ResidencePermit => __('registration.residence-permit'),
self::SchoolCertificate => __('registration.school-certificate'),
self::AppfCopy => __('registration.appf-copy'),
self::AppfOriginal => __('registration.appf-original'),
default => 'unknown',
});
}
}