Make MDProcessType JSON serializable
This commit is contained in:
2 files changed
+19
-1
No files matched your search
@@ -9,7 +9,7 @@
|
|||||||
/**
|
/**
|
||||||
* Represents a possible type of internal processes in a museum.
|
* Represents a possible type of internal processes in a museum.
|
||||||
*/
|
*/
|
||||||
enum MDProcessType implements MDValueEnumInterface {
|
enum MDProcessType implements MDValueEnumInterface, JsonSerializable {
|
||||||
|
|
||||||
case project;
|
case project;
|
||||||
case grant_application;
|
case grant_application;
|
||||||
@@ -107,4 +107,15 @@ public function getTledName(MDTlLoader $tlLoader):string {
|
|||||||
return $tlLoader->tl("process_types", "process_types", $this->name);
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -55,4 +55,11 @@ public static function getSortedList(MDTlLoader $tlLoader):array;
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getTledName(MDTlLoader $tlLoader):string;
|
public function getTledName(MDTlLoader $tlLoader):string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the option to serialize as a string during json_encode().
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function jsonSerialize():string;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user