Add new time_of_event time role
This commit is contained in:
2 files changed
+5
-6
No files matched your search
+1
-1
Submodule l18n updated: f53b03049a...8feb090adf.
@@ -1,9 +1,4 @@
|
||||
<?PHP
|
||||
/**
|
||||
* Represents a type of time related to an object group.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
|
||||
/**
|
||||
@@ -13,6 +8,7 @@ enum MDSeriesTimeRole implements MDValueEnumInterface, JsonSerializable {
|
||||
|
||||
case premiere;
|
||||
case time_of_presentation;
|
||||
case time_of_event;
|
||||
|
||||
/**
|
||||
* Returns a value of this type based on a string.
|
||||
@@ -26,6 +22,7 @@ public static function fromString(string $input):MDSeriesTimeRole {
|
||||
return match($input) {
|
||||
"premiere" => self::premiere,
|
||||
"time_of_presentation" => self::time_of_presentation,
|
||||
"time_of_event" => self::time_of_event,
|
||||
default => throw new MDpageParameterNotFromListException("Unknown series time role"),
|
||||
};
|
||||
|
||||
@@ -43,6 +40,7 @@ public static function fromInt(int $input):MDSeriesTimeRole {
|
||||
return match($input) {
|
||||
0 => self::premiere,
|
||||
1 => self::time_of_presentation,
|
||||
2 => self::time_of_event,
|
||||
default => throw new MDpageParameterNotFromListException("Unknown series time role"),
|
||||
};
|
||||
|
||||
@@ -118,6 +116,7 @@ public function toInt():int {
|
||||
return match($this) {
|
||||
self::premiere => 0,
|
||||
self::time_of_presentation => 1,
|
||||
self::time_of_event => 2,
|
||||
# default => throw new MDpageParameterNotFromListException("Unknown object record status"),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user