-
Notifications
You must be signed in to change notification settings - Fork 399
/
Copy pathOccupation.php
46 lines (41 loc) · 1.35 KB
/
Occupation.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
<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author Roardom <roardom@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
declare(strict_types=1);
namespace App\Enums;
enum Occupation: int
{
case CREATOR = 1;
case DIRECTOR = 2;
case WRITER = 3;
case PRODUCER = 4;
case COMPOSER = 5;
case CINEMATOGRAPHER = 6;
case EDITOR = 7;
case PRODUCTION_DESIGNER = 8;
case ART_DIRECTOR = 9;
case ACTOR = 10;
public static function from_tmdb_job(string $job_name): ?Occupation
{
return match ($job_name) {
"Director" => self::DIRECTOR,
"Screenplay" => self::WRITER,
"Producer", "Co-Producer", "Associate Producer" => self::PRODUCER,
"Original Music Composer" => self::COMPOSER,
"Director of Photography" => self::CINEMATOGRAPHER,
"Editor" => self::EDITOR,
"Production Design" => self::PRODUCTION_DESIGNER,
"Art Direction" => self::ART_DIRECTOR,
default => null,
};
}
}