Make MDProcessType JSON serializable

This commit is contained in:
jrenslin committed 2022-10-16 01:13:33 +02:00
1 parent 42a02c186a
commit b6dcffdea4
2 files changed
+19 -1

No files matched your search

+12 -1
View File
@@ -9,7 +9,7 @@
/**
* 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 @@ public function getTledName(MDTlLoader $tlLoader):string {
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;
}
}
+7
View File
@@ -55,4 +55,11 @@ public static function getSortedList(MDTlLoader $tlLoader):array;
* @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;
}