diff --git a/src/enums/MDProcessType.php b/src/enums/MDProcessType.php index 9db2500..a37b73c 100644 --- a/src/enums/MDProcessType.php +++ b/src/enums/MDProcessType.php @@ -9,7 +9,7 @@ declare(strict_types = 1); /** * Represents a possible type of internal processes in a museum. */ -enum MDProcessType implements MDValueEnumInterface { +enum MDProcessType implements MDValueEnumInterface, JsonSerializable { case project; case grant_application; @@ -107,4 +107,15 @@ enum MDProcessType implements MDValueEnumInterface { return $tlLoader->tl("process_types", "process_types", $this->name); } + + /** + * Provides the option to serialize as a string during json_encode(). + * + * @return string + */ + public function jsonSerialize():string { + + return $this->name; + + } } diff --git a/src/enums/MDValueEnumInterface.php b/src/enums/MDValueEnumInterface.php index bd7b6d5..36c6bab 100644 --- a/src/enums/MDValueEnumInterface.php +++ b/src/enums/MDValueEnumInterface.php @@ -55,4 +55,11 @@ interface MDValueEnumInterface { * @return string */ public function getTledName(MDTlLoader $tlLoader):string; + + /** + * Provides the option to serialize as a string during json_encode(). + * + * @return string + */ + public function jsonSerialize():string; }