Make MDProcessType JSON serializable
This commit is contained in:
parent
42a02c186a
commit
b6dcffdea4
|
@ -9,7 +9,7 @@ declare(strict_types = 1);
|
||||||
/**
|
/**
|
||||||
* 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 @@ enum MDProcessType implements MDValueEnumInterface {
|
||||||
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 @@ interface MDValueEnumInterface {
|
||||||
* @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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user