Skip to content
Snippets Groups Projects
Commit 1d041d52 authored by Elmar Ludwig's avatar Elmar Ludwig Committed by Jan-Hendrik Willms
Browse files

implement JsonSerializable for I18NString, fixes #1672

Closes #1672

Merge request studip/studip!1076
parent 2f358618
No related branches found
No related tags found
No related merge requests found
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
/** /**
* I18NString class * I18NString class
*/ */
class I18NString class I18NString implements JsonSerializable
{ {
/** /**
* Text in default content language. * Text in default content language.
* *
...@@ -77,6 +76,16 @@ class I18NString ...@@ -77,6 +76,16 @@ class I18NString
return (string) $this->base; return (string) $this->base;
} }
/**
* Return the JSON representation of this i18n field in selected language.
*
* @return string
*/
public function jsonSerialize()
{
return (string) $this;
}
/** /**
* Sets the language the content is translated into. * Sets the language the content is translated into.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment